Won't take action on this enhancement issue until further feedback.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
In issue 100 nearly the same task is discussed. Mine is different to
this because I want to call the function after i filled out a field
and reftex-label uses this filed as input. #100 calls the function
immediately after expansion.
I tried to combine your answer and the answer to #100, but it does not
work yet:
$1 is mirrored but reftex is not called. it jumpes directly to next
field.
Secondly I tried:
\section{${1:Titel der Tour?}}%
\index{$1}%
\index{${2:$$(if (eq yas/moving-away-p t) (reftex-label nil 'dont-
insert))}}%
%
$2 is only a dummy, I press TAB. reftex-label is called indeed,
suggests the label. I press enter to accept, but noting is inserted
and yas jumps to the next input field
Maybe you have another idea?
Thanks, Peter
On 5 Sep., 14:07, codesite-nore...@google.com wrote:
> Won't take action on this enhancement issue until further feedback.
> --
> You received this message because you are listed in the owner
> or CC fields of this issue, or because you starred this issue.
> You may adjust your issue notification preferences at:http://code.google.com/hosting/settings
Mirror transformations are basically functions of the text (text or yas/text variable) that is present on the field they mirror. YASnippet wasn't designed to handle stuff such as side effects, which is one of the things that might make your intention work.
Consider the following *workaround*, check if it works
The my-reftex-cache variable implements the side-effect communication between the field and the mirror. Then you need the first progn line to initialize the variable. Then you need a **really** dirty hack where you force a mirror update. This is not guaranteed to work in the future (or in the present, for that matter), since it uses internal yasnippet workings which might change in the future.
But I ask you if you'd rather not use this:
\section{${1:"Titel der Tour"}}% \index{${2:"waiting..."$(unless yas/modified-p (reftex-label nil 'dont- insert))}}%
The only *inconvenient * here is that you get a chance to change the value inserted by reftex-label. Other than that, it's much cleaner, and is the "recommended" way.
Naturally, I didn't think of your scenario when I designed this feature. Its possible to make the first alternative cleaner in the future, I'll leave the issue open, maybe retitle it.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
thank you very much! I can now completely substitute msf abbrev with
yasnippet.
The version 2 works, and with the additional code it is perfect, the
same behaviour as in msf.
For the record: The snippet has to be slightly modified, because
reftex-label with parameter dont-insert does not write the \label{}.
So the complete snippet is:
> --
> You received this message because you are listed in the owner
> or CC fields of this issue, or because you starred this issue.
> You may adjust your issue notification preferences at:http://code.google.com/hosting/settings