From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "FRC" Newsgroups: gmane.emacs.help Subject: Re: tempo in JDE: completion with Date: Tue, 16 Sep 2003 21:50:29 +0200 Organization: Wanadoo, l'internet avec France Telecom Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1063742662 31306 80.91.224.253 (16 Sep 2003 20:04:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 Sep 2003 20:04:22 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 16 22:04:21 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19zM3g-00016H-00 for ; Tue, 16 Sep 2003 22:04:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19zM15-0000sh-JX for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2003 16:01:39 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!wanadoo.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: amontsouris-108-1-8-175.w217-128.abo.wanadoo.fr Original-X-Trace: news-reader1.wanadoo.fr 1063741829 14447 217.128.29.175 (16 Sep 2003 19:50:29 GMT) Original-X-Complaints-To: abuse@wanadoo.fr Original-NNTP-Posting-Date: 16 Sep 2003 19:50:29 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-Xref: shelby.stanford.edu gnu.emacs.help:116637 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12558 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12558 I found out that a 'no-self-insert property can be put in the plist of the symbol present in the function cell of the entry in the abbrev table/obarray. If the function returns non-nil, the char is discarded - which is exactly what I was looking for. FRC "FRC" a écrit dans le message de news:bjr4ob$o6t$1@news-reader4.wanadoo.fr... > Hi, > > I use NTEmacs and JDE mode w/ ECB to write Java code and I like them much, > although it did take some time to configure everything to my taste. > One (minor) thing I'd like to change is the way the 'for', 'if' etc... > abbrevs expansion deal with the last inserted char (the one that triggered > the expansion). > My understanding is that JDE tempo template functions are put in the > function cell of the entries in the abbrev table - these functions are > called when the abbrev is expanded. As far as I'm concerned, I always expand > the abbrevs by hitting just after the abbrev. This is usually fine, > except for these tempo-based expansions, which more often than not define > some tempo-mark in the middle of the expansion (eg. to define the loop > variables in the 'for' statement etc...). In these cases, the char > is inserted after the expansion, right where the expansion left the point; > but I always delete that space, b/c I don't want it and if I did I would put > it in the tempo template in the 1st place. For example, the 'if' expansion > sets the point just after the opening paranthesis, but then the > self-inserts itself there, although I'll never want a space here. I > appreciate that this insertion is perfectly consistent, but how can I get > rid of it *only* for the tempo-based expansions (I don't want to discard the > space when I expand 'public' or 'interface' for instance) ? > I tried to bind some tempo-space function of my own to , but this > func doesn't know if I want to keep the space or not (ie. if the abbrev has > been expanded with tempo). I could use brute-force and list all the > tempo-based abbrevs and checks if current abbrev matches one of them, but > there must be a better way. > My guess is that I need a mean to cancel the char insertion from > within the tempo template, but I didn't manage to do so (looked at > discard-input and another unread-xxx function). > How can I sort this out (apart from hitting C-x ' instead of ) ? > > FRC > >