]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid infloop in which-function-mode when a vc file has changed
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 17 Oct 2020 08:29:15 +0000 (10:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 17 Oct 2020 08:29:15 +0000 (10:29 +0200)
* lisp/vc/diff-mode.el (diff-find-source-location): Avoid warnings
when called from which-function-mode and the file has changed
(bug#42818).

lisp/vc/diff-mode.el

index d586afb97b0ef75f1fdd807d101cb933ad4ae736..7c9ad25eb31071957c3421134edbbbfd0234da56 100644 (file)
@@ -1860,7 +1860,10 @@ SWITCHED is non-nil if the patch is already applied."
           (buf (if revision
                     (let ((vc-find-revision-no-save t))
                       (vc-find-revision (expand-file-name file) revision diff-vc-backend))
-                  (find-file-noselect file))))
+                  ;; NOPROMPT is only non-nil when called from
+                  ;; `which-function-mode', so avoid "File x changed
+                  ;; on disk. Reread from disk?" warnings.
+                  (find-file-noselect file noprompt))))
       ;; Update the user preference if he so wished.
       (when (> (prefix-numeric-value other-file) 8)
        (setq diff-jump-to-old-file other))