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 #34 received at 5805 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Bob Nnamtrop <bobnnamtrop <at> gmail.com>
Cc: 5805 <at> debbugs.gnu.org
Subject: Re: bug#5805: 23.3 abbrev-insert needs a limited save-excursion
Date: Thu, 07 Jul 2011 16:59:13 -0400
tags 5805 patch
thanks

> I agree with the original poster that a save-excursion is needed in
> abbrev-expand and by making its scope limited (see below) it will not
> interfere with abbrevs that want to change point. The reason I find it
> annoying the way it is now is that some modes (e.g., idlwave) use
> abbrev's extensively to change keywords (e.g. capitalize them). These
> are defined without the leading "\". So if I am any number of lines
> with only whitespace below a keyword defined in this way (e.g. endfor)
> and run expand-abbrev then the point moves even if no visible change
> takes place. This is a VERY common occurrence for me since in viper
> mode changing from insert to vi mode runs expand-abbrev! Placing the
> save-excursion just around the part of abbrev-insert that actually
> expands the abbrev fixes this problem and does not limit abbrev's from
> moving the point (idlwave does this extensively as well and I've
> tested that it is not impacted).

Hmm... sounds like an interesting solution.  I'll take a closer look and
get back to you.  Thank you.

> Here is the diff against the
> abbrev.el in emacs 23.3 (note that whitespace not adjusted).

Highly appreciated.


        Stefan




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.