help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Don't you think this would be a nice feature? (Place holder)


From: Tim X
Subject: Re: Don't you think this would be a nice feature? (Place holder)
Date: Sun, 28 Sep 2008 16:37:21 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Weiwei <shuww1980@gmail.com> writes:

> Thanks Tim. The problem I try to state is how to quickly jump to
> places which is already there. I never used tempo, but have a little
> bit of experience with skeleton. I defined a skeleton which helps me
> to insert the following environment by typing "isub" followed by
> space:
>
> \begin{figure}[H]
>   \centering
>   \subfigure[]{\includegraphics[width=3.1in]{}}
>   \subfigure[]{\includegraphics[width=3.1in]{}}
>   \caption{}
>   \label{fig:}
> \end{figure}
>
> Now the cursor is in between the first "[]". After I type something, I
> want to jump to "{}" in the same line to fill the eps filename. Can
> skeleton or tempo do this job? I have used a third-party template mode
> before (not tempo though), and it let me fill staff such as date,
> author, etc. in the minibuffer, which I feel not that convenient.
> Correct me if skeleton or tempo is able to do the job and I will give
> them a try. Thanks!
>
> Weiwei
>

OK, now I understand what your after a bit better. The standard way to
do this would be to have the template prompt you for the values in the
mini-buffer and then it would insert them in the appropriate
place. This is also how many of the pre-defined environment insertion
facilities of auctex work. However, from what you say, you don't like
this approach. 

Off the top of my head, I can't see how this could be done easily using
existing template facilities. However, both tempo and skeleton do
provide ways of incorporating elisp into the definition, so it should be
possible, but perhaps not trivial, especially if you wanted something
fairly generic rather than coded for specific examples. For example, how
can emacs know when you have filled in the first value and then
automatically move you to the next value. This is why using the
mini-buffer to get the values is so convenient. All the template needs
to know is where to insert the values. There is no need to try and find
a mechanism to tell emacs when you have finished putting in the first
value and then to jump to the next spot to let you fill in the next
value and so on. 

I personally don't have a problem with being prompted for values in the
mini-buffer. I find that as long as you have the template bound to a
convenient key or triggered by an abbrev, the use of the mini-buffer
doesn't interrupt my workflow or thoughts at all. In fact, as you can
also take advantage of completion and default values, it can be very
convenient and it certainly simplifies matters.

Sorry I couldn't provide more substantial help.

Tim


>

-- 
tcross (at) rapttech dot com dot au


reply via email to

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