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

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

Re: tempo in JDE: completion with <spc>


From: FRC
Subject: Re: tempo in JDE: completion with <spc>
Date: Tue, 16 Sep 2003 21:50:29 +0200

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" <address@hidden> a écrit dans le message de
news:address@hidden
> 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 <space> 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 <space> 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 <space>
> 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 <space>, 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 <space> 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 <space>) ?
>
> FRC
>
>




reply via email to

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