From: Juri Linkov Date: Mon, 31 Jan 2022 18:46:06 +0000 (+0200) Subject: * lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer. X-Git-Tag: emacs-29.0.90~2614 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=70f994f6d098c6830cab1fb396d46c42782e7527;p=emacs.git * lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer. Support the case when reverting is in the buffer with a name other than the default name "*vc-diff*". Then don't try to switch to the buffer "*vc-diff*" with an assumption that revert-buffer is always performed in the current buffer (bug#28852). --- diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0096a5fcb3f..a6124acadd2 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1798,10 +1798,9 @@ Return t if the buffer had changes, nil otherwise." (coding-system-for-read (if files (vc-coding-system-for-diff (car files)) 'undecided)) (orig-diff-buffer-clone - (if (and (get-buffer buffer) revert-buffer-in-progress-p) - (with-current-buffer buffer - (clone-buffer - (generate-new-buffer-name " *vc-diff-clone*") nil))))) + (if revert-buffer-in-progress-p + (clone-buffer + (generate-new-buffer-name " *vc-diff-clone*") nil)))) ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style ;; EOLs, which will look ugly if (car files) happens to have Unix ;; EOLs.