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#4356: 23.1.50; expand-abbrev changes point erroneously Date: Tue, 15 Sep 2009 22:46:00 -0400 Message-ID: References: <87ljksuzzx.fsf@gmail.com> Reply-To: Stefan Monnier , 4356@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253070444 20430 80.91.229.12 (16 Sep 2009 03:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Sep 2009 03:07:24 +0000 (UTC) Cc: 4356@emacsbugs.donarmstrong.com To: Vincent =?UTF-8?Q?Bela=C3=AFche?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 16 05:07:17 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MnkrR-0001HX-OT for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Sep 2009 05:07:14 +0200 Original-Received: from localhost ([127.0.0.1]:47403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnkrQ-0004VM-Rq for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Sep 2009 23:07:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnkrN-0004VA-6g for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 23:07:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnkrH-0004Nx-Hr for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 23:07:07 -0400 Original-Received: from [199.232.76.173] (port=53093 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnkrH-0004Nn-Co for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 23:07:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60459) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnkrG-0005jK-Ru for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 23:07:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8G370WE021388; Tue, 15 Sep 2009 20:07:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8G2t8Em018834; Tue, 15 Sep 2009 19:55:08 -0700 Resent-Date: Tue, 15 Sep 2009 19:55:08 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 16 Sep 2009 02:55:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4356 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4356-submit@emacsbugs.donarmstrong.com id=B4356.125306916917519 (code B ref 4356); Wed, 16 Sep 2009 02:55:07 +0000 Original-Received: (at 4356) by emacsbugs.donarmstrong.com; 16 Sep 2009 02:46:09 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8G2k6Dp017501 for <4356@emacsbugs.donarmstrong.com>; Tue, 15 Sep 2009 19:46:08 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAM7tr0pFpZBe/2dsb2JhbACBU91JhBcFh3o X-IronPort-AV: E=Sophos;i="4.44,394,1249272000"; d="scan'208";a="45748721" Original-Received: from 69-165-144-94.dsl.teksavvy.com (HELO ceviche.home) ([69.165.144.94]) by ironport2-out.pppoe.ca with ESMTP; 15 Sep 2009 22:46:01 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id EC50DB449F; Tue, 15 Sep 2009 22:46:00 -0400 (EDT) In-Reply-To: <87ljksuzzx.fsf@gmail.com> ("Vincent =?UTF-8?Q?Bela=C3=AFche"'s?= message of "Sun, 06 Sep 2009 12:30:26 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 15 Sep 2009 23:07:07 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31129 Archived-At: > Here is the bug description. I found this editing some Visual Basic file > with using http://www.emacswiki.org/emacs/visual-basic-mode.el > If for instance I type after (--!-- showing point when I type ): > MyVar = MyFun(1,True)--!-- > Then in visual basic mode visual-basic-newline-and-indent is called, > which in turn calls (expand-abbrev). After (expand-abbrev) is called, > point will be moved as follows: > MyVar = MyFun(1,True--!--) > because `True' is one abbreviation. I have patched visual-basic mode, so > that a save-excursion encloses the call of expand-abbrev, otherwise I > would get: > MyVar = MyFun(1,True > --!--) > which is not wanted. Stefan Monnier (monnier@IRO.UMontreal.CA) confirmed > this is a bug of expand-abbrev, and asked me to repport it. > The wanted behaviour would be that after expanding `True', point would > come back to after the `)' where it originally was. Having looked into it some more, I'm not 100% convinced it's a bug any more. Here's why: `expand-abbrev' may run arbitrary code, and some abbrevs don't just replace text with something else but also prompt and/or move point (e.g. skeletons). So running expand-abbrev from visual-basic-newline-and-indent just doesn't sound right since it may conflict with user-defined abbreviations. I.e. the problem you're seeing can also happen in Emacs-22 depending on the user's own abbreviations. So the VBM code either needs a save-excursion, or needs to refrain from calling expand-abbrev from visual-basic-newline-and-indent. Stefan