emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Curious behavior in find-alternate-file.


From: Karl Fogel
Subject: Re: Curious behavior in find-alternate-file.
Date: Tue, 08 Sep 2009 17:43:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Stefan Monnier <address@hidden> 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]