From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5805: 23.3 abbrev-insert needs a limited save-excursion Date: Thu, 07 Jul 2011 16:59:13 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310073836 9232 80.91.229.12 (7 Jul 2011 21:23:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2011 21:23:56 +0000 (UTC) Cc: 5805@debbugs.gnu.org To: Bob Nnamtrop Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 07 23:23:52 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qew34-0000jb-26 for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2011 23:23:50 +0200 Original-Received: from localhost ([::1]:47162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qew32-0007Wo-LY for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2011 17:23:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QevgA-0000eN-Uw for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2011 17:00:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qevg5-0000Vw-Uu for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2011 17:00:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qevg5-0000Uv-Lx for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2011 17:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qevg4-0002Qh-03; Thu, 07 Jul 2011 17:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2011 21:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5805 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5805-submit@debbugs.gnu.org id=B5805.13100724009301 (code B ref 5805); Thu, 07 Jul 2011 21:00:03 +0000 Original-Received: (at 5805) by debbugs.gnu.org; 7 Jul 2011 21:00:00 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qevfz-0002Pv-H2 for submit@debbugs.gnu.org; Thu, 07 Jul 2011 16:59:59 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qevfj-0002Ol-SX; Thu, 07 Jul 2011 16:59:57 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p67KxDns009224; Thu, 7 Jul 2011 16:59:14 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id D3BCAB4177; Thu, 7 Jul 2011 16:59:13 -0400 (EDT) In-Reply-To: (Bob Nnamtrop's message of "Thu, 7 Jul 2011 08:48:36 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3911=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3911> : streams <658563> : uri <909078> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 07 Jul 2011 17:00:04 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:48215 Archived-At: 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