]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer.
authorJuri Linkov <juri@linkov.net>
Mon, 31 Jan 2022 18:46:06 +0000 (20:46 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 31 Jan 2022 18:46:06 +0000 (20:46 +0200)
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).

lisp/vc/vc.el

index 0096a5fcb3f16cdb2528054596975348f7fc75e5..a6124acadd2ce42aa3b3557b4aae44fc8b211896 100644 (file)
@@ -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.