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#7854: 24.0.50; Buffer *temp* modified; kill anyway? Date: Mon, 24 Jan 2011 15:36:40 -0500 Message-ID: References: <20110117164327.72fn7tc54w0ks8cs@imap.uni-ulm.de> <87fwsqd6n6.fsf@marauder.physik.uni-ulm.de> <87hbd187nb.fsf@marauder.physik.uni-ulm.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295902518 15611 80.91.229.12 (24 Jan 2011 20:55:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 24 Jan 2011 20:55:18 +0000 (UTC) To: 7854-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 24 21:55:14 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 1PhTRQ-0003cS-V0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 21:55:13 +0100 Original-Received: from localhost ([127.0.0.1]:41343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTRP-0000Km-Jt for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 15:55:11 -0500 Original-Received: from [140.186.70.92] (port=47545 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTRH-0000Ij-FB for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 15:55:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTRE-00047C-GX for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 15:55:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTRE-000477-Ds for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 15:55:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PhT26-000201-2l for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2011 15:29:02 -0500 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jan 2011 20:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 7854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 7854@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 7854-done@debbugs.gnu.org id=D7854.12959009217655 (code D ref 7854); Mon, 24 Jan 2011 20:29:01 +0000 Original-Received: (at 7854-done) by debbugs.gnu.org; 24 Jan 2011 20:28:41 +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 1PhT1k-0001zQ-HT for submit@debbugs.gnu.org; Mon, 24 Jan 2011 15:28:40 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PhT1i-0001zC-Id for 7854-done@debbugs.gnu.org; Mon, 24 Jan 2011 15:28:39 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQGALpxPU1MCo4O/2dsb2JhbACWTI4ddLtugnmCVwSEcI46 X-IronPort-AV: E=Sophos;i="4.60,371,1291611600"; d="scan'208";a="89097213" Original-Received: from 76-10-142-14.dsl.teksavvy.com (HELO pastel.home) ([76.10.142.14]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Jan 2011 15:36:40 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 461A358C4E; Mon, 24 Jan 2011 15:36:40 -0500 (EST) In-Reply-To: <87hbd187nb.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Sat, 22 Jan 2011 13:06:32 +0100") 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: Mon, 24 Jan 2011 15:29:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:43614 Archived-At: >> Can you check to see if the quick-fix below solves the problem? > It solves the problem. Thank you! Thanks for confirming. I've installed the patch below in the emacs-23 branch, which should fix it right. Stefan === modified file 'lisp/files.el' --- lisp/files.el 2011-01-20 02:55:36 +0000 +++ lisp/files.el 2011-01-24 20:22:34 +0000 @@ -6118,8 +6118,7 @@ (substitute-in-file-name identity) ;; `add' means add "/:" to the result. (file-truename add 0) - ;; `quote' means add "/:" to buffer-file-name. - (insert-file-contents quote 0) + (insert-file-contents insert-file-contents 0) ;; `unquote-then-quote' means set buffer-file-name ;; temporarily to unquoted filename. (verify-visited-file-modtime unquote-then-quote) @@ -6150,20 +6149,18 @@ "/" (substring (car pair) 2))))) (setq file-arg-indices (cdr file-arg-indices)))) - (cond ((eq method 'identity) - (car arguments)) - ((eq method 'add) - (concat "/:" (apply operation arguments))) - ((eq method 'quote) - (unwind-protect + (case method + (identity (car arguments)) + (add (concat "/:" (apply operation arguments))) + (insert-file-contents + (let ((visit (nth 1 arguments))) + (prog1 (apply operation arguments) - (setq buffer-file-name (concat "/:" buffer-file-name)))) - ((eq method 'unquote-then-quote) - (let (res) - (setq buffer-file-name (substring buffer-file-name 2)) - (setq res (apply operation arguments)) - (setq buffer-file-name (concat "/:" buffer-file-name)) - res)) + (when (and visit buffer-file-name) + (setq buffer-file-name (concat "/:" buffer-file-name)))))) + (unquote-then-quote + (let ((buffer-file-name (substring buffer-file-name 2))) + (apply operation arguments))) (t (apply operation arguments)))))