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#7946: Referring to a marker changes Emacs' behaviour. Date: Wed, 02 Feb 2011 10:54:56 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296668462 3074 80.91.229.12 (2 Feb 2011 17:41:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Feb 2011 17:41:02 +0000 (UTC) Cc: 7946-done@debbugs.gnu.org To: Le Wang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 02 18:40:57 2011 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.69) (envelope-from ) id 1Pkgh7-0007XB-QE for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Feb 2011 18:40:54 +0100 Original-Received: from localhost ([127.0.0.1]:40412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkgh3-0000SR-NM for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Feb 2011 12:40:37 -0500 Original-Received: from [140.186.70.92] (port=42849 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkfDY-0000tW-CL for bug-gnu-emacs@gnu.org; Wed, 02 Feb 2011 11:06:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkfDG-0001nq-Ez for bug-gnu-emacs@gnu.org; Wed, 02 Feb 2011 11:05:50 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkfDG-0001nl-Bp for bug-gnu-emacs@gnu.org; Wed, 02 Feb 2011 11:05:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pkev8-00006F-23 for bug-gnu-emacs@gnu.org; Wed, 02 Feb 2011 10:47:02 -0500 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Feb 2011 15:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 7946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 7946@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 7946-done@debbugs.gnu.org id=D7946.1296661595340 (code D ref 7946); Wed, 02 Feb 2011 15:47:01 +0000 Original-Received: (at 7946-done) by debbugs.gnu.org; 2 Feb 2011 15:46:35 +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 1Pkeug-00005R-LI for submit@debbugs.gnu.org; Wed, 02 Feb 2011 10:46:34 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pkeud-00005E-HA for 7946-done@debbugs.gnu.org; Wed, 02 Feb 2011 10:46:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAKsMSU1Ld/8K/2dsb2JhbAClGHS8GYVTBIR4jxQ X-IronPort-AV: E=Sophos;i="4.60,414,1291611600"; d="scan'208";a="90264201" Original-Received: from 75-119-255-10.dsl.teksavvy.com (HELO ceviche.home) ([75.119.255.10]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 02 Feb 2011 10:54:57 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id C0477660DC; Wed, 2 Feb 2011 10:54:56 -0500 (EST) In-Reply-To: (Le Wang's message of "Mon, 31 Jan 2011 14:45:43 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 02 Feb 2011 10:47:02 -0500 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: , 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:43840 Archived-At: > I found an issue where evaluating this line or not causes Emacs behaviour > change: > (format "%s" marked-point) The patch below appears to fix the problem for me. I've installed it in the emacs-23 branch. The problem was that current-column uses a cache to try and speed up some cases, and the cache was not flushed when exiting a save-restriction. The workaround you used works because `set-buffer' flushes the cache and `format' uses set-buffer internally. Stefan === modified file 'src/editfns.c' --- src/editfns.c 2011-01-02 23:50:46 +0000 +++ src/editfns.c 2011-02-02 15:45:27 +0000 @@ -3347,6 +3347,9 @@ } } + /* Changing the buffer bounds invalidates any recorded current column. */ + invalidate_current_column (); + if (cur) set_buffer_internal (cur);