emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [yasnippet] can not creating links with description


From: Bianca Lutz
Subject: Re: [O] [yasnippet] can not creating links with description
Date: Tue, 9 Aug 2011 17:40:40 +0200

I just realized that the test for field being non-nil is superfluous
in the example below -- the usual copy and paste mess got me. Thus,
you may omit it, i.e. use

(concat "companie: " (buffer-substring ...))

instead of

(concat "companie: " (and field (buffer-substring ...)))

Bianca.

On Tue, Aug 9, 2011 at 5:05 PM, Bianca Lutz <address@hidden> wrote:
> Hi Karl,
>
> I do not know how to accomplish this with a single field but the
> following workaround might be sufficient:
>
> ,----[ ~/snippets/org-mode/vkcomp ]
> | # name : expand link to company
> | # --
> | [[file:~/share/all/org-mode/contacts.org::*$1][${2:$$(unless yas/modified-p
> |  (let ((field (nth 0 (yas/snippet-fields (first (yas/snippets-at-point))))))
> |    (concat "companie: "
> |            (and field (buffer-substring
> |                           (yas/field-start field)
> |                           (yas/field-end field))))))]] $0
> `----
>
> As long as the first field is active the second one is empty, thus, no
> troublesome link hiding will occur. As I said, this isn't exactly what
> you were asking for, since you have to press TAB a second time to
> actually exit the snippet.
>
> Best regards,
> Bianca.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]