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


View this message in rfc822 format

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Maguire\, Andrew \(GE Infra\, Energy\)" <andrew.maguire <at> ge.com>
Cc: 5805 <at> debbugs.gnu.org
Subject: bug#5805: 23.1; abbrev-insert does not protext itself with save-excursion
Date: Sat, 10 Apr 2010 12:04:13 -0400
> In our code we use abbrev to dynamically expand certain
> keywords. However, the new lisp implementation is more eager in
> finding things to check, ie. it is able to look back past non-word
> characters to see if an abbrev is to be found.  In this situation it
> is essential to do save-excursion.
>
> Ideally, either insert-abbrev should do a save-excursion itself or all
> calls to it should.  In our code, expand-abbrev is call which
> internally calls abbrev-insert.
>
> Alternatively, is it the recommendation for user code to surround all
> "abbrev" calls with save-excursion now?

Do you have a recipe for reproducing a bug?  By default, the abbrev code
is not supposed to change point, so there should be no advantage adding
a save-excursion.  I don't see why we should constrain the ability of
user-defined functions in `abbrev-expand-functions' to change point, if
they want to.

Or do you mean save-match-data?




This bug report was last modified 13 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.