From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Don't you think this would be a nice feature? (Place holder) Date: Sun, 28 Sep 2008 16:37:21 +1000 Organization: Rapt Technologies Message-ID: <87r674lqse.fsf@lion.rapttech.com.au> References: <5cc115cf-bf80-4675-886c-cb157440fe6e@n38g2000prl.googlegroups.com> <87od29jge8.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222584054 28739 80.91.229.12 (28 Sep 2008 06:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Sep 2008 06:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 28 08:41:52 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KjpyJ-0003pK-AH for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 08:41:35 +0200 Original-Received: from localhost ([127.0.0.1]:55409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjpxG-0006te-Fb for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 02:40:30 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news.astraweb.com!border2.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:MlVVKwBAARt+0pfU5EPyPxTMiaQ= Original-Lines: 63 Original-NNTP-Posting-Host: 9fc0f818.news.astraweb.com Original-X-Trace: DXC=0?3SVGTR`=ZX:B>h5BA List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58157 Archived-At: Weiwei 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