GNU bug report logs - #5805
23.1; abbrev-insert does not protext itself with save-excursion

Previous Next

Package: emacs;

Reported by: "Maguire, Andrew (GE Infra, Energy)" <andrew.maguire <at> ge.com>

Date: Tue, 30 Mar 2010 16:37:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 5805 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Maguire\, Andrew \(GE Infra\, Energy\)" <andrew.maguire <at> ge.com>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 5805 <at> debbugs.gnu.org
Subject: Re: bug#5805: 23.1;
	abbrev-insert does not protext itself with save-excursion
Date: Sat, 10 Apr 2010 15:10:13 -0400
> 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.