all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: William Xu <william.xwl@gmail.com>
Cc: 11605@debbugs.gnu.org
Subject: bug#11605: 24.1.50; vc-ediff revert annoyance
Date: Wed, 24 Feb 2016 17:33:44 +1100	[thread overview]
Message-ID: <87twkybos7.fsf@gnus.org> (raw)
In-Reply-To: <CACzMC-AyMUwxot1UPP-a8WhCURvjHrH_9nqkPEZhknzMhygZSg@mail.gmail.com> (William Xu's message of "Sat, 2 Jun 2012 12:31:10 +0800")

William Xu <william.xwl@gmail.com> writes:

>   1. emacs -Q
>   2. visit a version controlled file, say `foo'.
>   3. M-x vc-ediff, run it couple of times.
>
> You will see this annoying message many times:
>
>   File foo.~master~ changed on disk.  Reread from disk? (yes or no)

I can confirm that this bug is still present in the Emacs trunk.

> The reason is the ~master~ file is checked out everytime we run
> vc-ediff, and after ediff session, the ~master~ buffer is always left
> there, hence, when running vc-ediff multiple times it constantly asks
> you whether you want to revert.  Why not let it revert automatically?
>
> How about this patch?

[...]

I think the patch sounds reasonable, but the vc machinery is something
with which I'm not overly familiar.

Could somebody take a peek at this patch?

> From d2af0f4dcc81b39d9360135244d6870388a264a3 Mon Sep 17 00:00:00 2001
> From: William Xu <william.xwl@gmail.com>
> Date: Sat, 2 Jun 2012 12:16:45 +0800
> Subject: [PATCH] (vc-find-revision): Auto revert file revision buffer
>  quietly.
>
> ---
>  lisp/vc/vc.el |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
> index 87e4e1c..bd337d0 100644
> --- a/lisp/vc/vc.el
> +++ b/lisp/vc/vc.el
> @@ -1815,11 +1815,13 @@ Use BACKEND as the VC backend if specified."
>  		(delete-file filename))))
>  	  (vc-mode-line file))
>  	(message "Checking out %s...done" filename)))
> -    (let ((result-buf (find-file-noselect filename)))
> +    (let ((result-buf (or (get-file-buffer filename)
> +                          (find-file-noselect filename))))
>        (with-current-buffer result-buf
>  	;; Set the parent buffer so that things like
>  	;; C-x v g, C-x v l, ... etc work.
> -	(set (make-local-variable 'vc-parent-buffer) filebuf))
> +	(set (make-local-variable 'vc-parent-buffer) filebuf)
> +        (revert-buffer nil t))
>        result-buf)))
>  
>  ;; Header-insertion code

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2016-02-24  6:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02  4:31 bug#11605: 24.1.50; vc-ediff revert annoyance William Xu
2016-02-24  6:33 ` Lars Ingebrigtsen [this message]
2016-02-26  0:38   ` Dmitry Gutov
2016-02-26  6:01     ` Lars Ingebrigtsen
2016-02-26 10:36       ` Dmitry Gutov
2016-02-26  9:38     ` William Xu
2016-02-26 10:10       ` Dmitry Gutov
2019-06-27 15:16     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twkybos7.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=11605@debbugs.gnu.org \
    --cc=william.xwl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.