GNU bug report logs -
#5805
23.1; abbrev-insert does not protext itself with save-excursion
Previous Next
Full log
View this message in rfc822 format
I do appreciate the need for some abbrevs to move point and that I am
reporting a perceived change in behaviour.
However, the question is whether the change in behaviour is deliberate
or not.
If a user wishes to create an abbrev that requires point to move
presumably they have to create the abbrev in a certain way.
The example you give below would still require user code to move point
to between the LaTeX statements.
i.e If I created a simple global abbrev to expand "begi" point would be
left after the \end{itemize}^
So how should I fix my code that uses expand-abbrev to work in Emacs 23?
It currently works as is in Emacs 20, 21 and 22.
Thanks,
Andrew
-----Original Message-----
From: Stefan Monnier [mailto:monnier <at> iro.umontreal.ca]
Sent: 10 April 2010 20:10
To: Maguire, Andrew (GE Infra, Energy)
Cc: Chong Yidong; 5805 <at> debbugs.gnu.org
Subject: Re: bug#5805: 23.1; abbrev-insert does not protext itself with
save-excursion
> Create a global abbrev, abbrv => abbrev
> Type the following, ^ indicating point location.
> abbrv ()
> ^
> Then press C-x ' to expand the abbrev on the line.
> abbrev ()
> ^
> Observe that point ^ is now before the ()s.
Right. The question now is: why is that a problem?
I ask because for some abbrevs, moving point isa feature, e.g. an abbrev
that uses skeletons to expand
begi
^
into
\begin{itemize} \end{itemize}
^
so maybe the problem is that your code makes unwarranted assumptions
about what abbrevs can do, or maybe your code knows that it won't
encounter such abbreviations or that it wouldn't care about their
point-placement feature, so it could/should use save-excursion.
> ;; Emacs 23 has a lisp implementation for abbrevs.
BTW, the problem is not that the implementation is in Lisp, but that it
behaves differently.
Stefan
This bug report was last modified 13 years and 323 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.