Hi,
On Thu, Jul 12, 2012 at 8:27 PM, Dror Atariah <
dro...@gmail.com> wrote:
> So you're saying that my code is correct but there's some feature/bug which
> doesn't make it happen as expected? I have to say I didn't understand much
> from the link you added, as I am a newbie to lisp...
More or less, but you're right I didn't make myself very clear. I
*was* saying that the behaviour you request might not be currently
supported by yasnippet in its current state and that the feature
requested in
https://github.com/capitaomorte/yasnippet/issues/28
would, in principle, allow you to write a little addition to your
snippet that makes it work like you intend it to.
But I have analysed this a bit more and remembered that yasnippet
*can* already solve your problem if you write your snippet as a
snippet-command. Try this
# -*- mode: snippet -*-
# name: latex footnote
# key: foot
# type: command
# --
(skip-syntax-backward " ")
(yas/expand-snippet "\\footnote{${1:the footnote test}}")
>
>
> On Thursday, July 12, 2012 8:23:51 PM UTC+2, Joao wrote:
>>
>> This is interesting and *might* be a use for the issue described in
>>
https://github.com/capitaomorte/yasnippet/issues/28. I've added your email
>> to the issue and you can track it's implementation there/solution there.
>>
>> Thanks,
>> João
>>
>> On Thursday, July 12, 2012 3:10:13 PM UTC+1, Dror Atariah wrote:
>>>
>>> I'm trying to write a snippet which will expand to "\footnote{}" in
>>> LaTeX. The problem is the final code should look like:
>>> Hello World\footnote{The footnote}
>>>
>>> The goal is to be able to type the following:
>>> w o r d SPC f o o t TAB
>>> which will expand to:
>>> word\footnote{}
>>> I manage to get the following result:
>>> word \footnote{}
>>> Note the space after 'word' which must not be there.
>>>
>>> I'm trying to use the backward-char function in the following way:
>>> `(backward-char 1)`\footnote{$1}$2
>>> but this doesn't work... I keep getting the space after the last word.
>>>
>>> How can I avoid this? What is the right way to go?
>
> --
> You received this message because you are subscribed to the Google Groups
> "smart-snippet and YASnippet" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/smart-snippet/-/e_AkB9gwbpkJ.
>
> To post to this group, send email to
smart-...@googlegroups.com.
> To unsubscribe from this group, send email to
>
smart-snippe...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/smart-snippet?hl=en.
--
João Távora