From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Curious behavior in find-alternate-file. Date: Tue, 08 Sep 2009 17:43:14 -0400 Message-ID: <87tyzd864t.fsf@red-bean.com> References: <87ws4e74lj.fsf@red-bean.com> Reply-To: Karl Fogel NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1252446215 24734 80.91.229.12 (8 Sep 2009 21:43:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2009 21:43:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 23:43:28 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ml8TH-000193-Kj for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2009 23:43:27 +0200 Original-Received: from localhost ([127.0.0.1]:43977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml8TH-0006vy-3W for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2009 17:43:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ml8TB-0006vr-6W for emacs-devel@gnu.org; Tue, 08 Sep 2009 17:43:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ml8T6-0006vd-Hc for emacs-devel@gnu.org; Tue, 08 Sep 2009 17:43:20 -0400 Original-Received: from [199.232.76.173] (port=38817 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml8T6-0006va-CD for emacs-devel@gnu.org; Tue, 08 Sep 2009 17:43:16 -0400 Original-Received: from sanpietro.red-bean.com ([66.146.206.141]:39614) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ml8T6-0005jv-1L for emacs-devel@gnu.org; Tue, 08 Sep 2009 17:43:16 -0400 Original-Received: from localhost ([127.0.0.1]:46190 helo=floss ident=kfogel) by sanpietro.red-bean.com with esmtp (Exim 4.69) (envelope-from ) id 1Ml8T4-00077e-Uz; Tue, 08 Sep 2009 16:43:15 -0500 In-Reply-To: (Stefan Monnier's message of "Tue, 08 Sep 2009 12:10:25 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115153 Archived-At: Stefan Monnier writes: > It's always worthwhile to use M-x vc-annotate and then `d' and/or `l' on > the relevant lines, to see how we got there. In the present case you'll > find the change described below, which indicates that your change > wouldn't be right either. Maybe Chong remembers what was the motivation > for that change? Well, I wasn't sophisticated enough to use vc-annotate :-), but I saw Chong's r1.878 via old-fashioned 'cvs log'. I assumed he was watching the discussion here, and would have said something if there was an important reason for the behavior, but perhaps that was too optimistic -- he does get a lot of mail, after all. Should I maybe mail him personally, or put "ATTN: Chong Yidong" in the subject, or something? Chong, the relevant recent change is: lisp/files.el: revision 1.1077 date: 2009-09-05 11:16:49 -0400; author: kfogel; state: Exp; lines: +6 -6; commitid: RHZgxPghVlEnfv2u; * lisp/files.el (find-alternate-file): If the old buffer is modified and visiting a file, behave similarly to `kill-buffer' when killing it, thus reverting to the pre-1.878 behavior; see http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00101.html for discussion. Also, consult `buffer-file-name' as a variable not as a function, for consistency with the rest of the code. -Karl > revision 1.878 > date: 2007-01-20 14:00:10 -0500; author: cyd; state: Exp; lines: +4 -4; > (find-alternate-file): Revert query message to Emacs 21 version. > > > --- files.el 6 Jan 2007 21:50:14 -0000 1.877 > +++ files.el 20 Jan 2007 19:00:10 -0000 1.878 > @@ -1223,11 +1223,11 @@ > (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) > (error "Aborted")) > (when (and (buffer-modified-p) (buffer-file-name)) > - (if (yes-or-no-p (format "Buffer %s is modified; save it first? " > + (if (yes-or-no-p (format "Buffer %s is modified; kill anyway? " > (buffer-name))) > - (save-buffer) > (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") > - (error "Aborted")))) > + (error "Aborted")) > + (save-buffer))) > (let ((obuf (current-buffer)) > (ofile buffer-file-name) > (onum buffer-file-number)