diff options
| author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-17 10:29:15 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-17 10:29:15 +0200 |
| commit | 0a3d584ce4167b0241bf2cdcf5c670fdea49f46f (patch) | |
| tree | 08bcc3953c1c7ce24533a3919fd42b1ac47ff0b8 | |
| parent | 6d0b2a60f6e3b20c807ae17f4afe8a327bea584b (diff) | |
| download | emacs-0a3d584ce4167b0241bf2cdcf5c670fdea49f46f.tar.gz | |
Avoid infloop in which-function-mode when a vc file has changed
* lisp/vc/diff-mode.el (diff-find-source-location): Avoid warnings
when called from which-function-mode and the file has changed
(bug#42818).
| -rw-r--r-- | lisp/vc/diff-mode.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index d586afb97b0..7c9ad25eb31 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -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)) |
