aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2023-01-24 20:48:20 +0200
committerJuri Linkov2023-01-24 20:48:20 +0200
commitecf500b5e34f3767df6b41f110efcf307c74ebc9 (patch)
tree1a8ec14d01fc794ad0d4e048265d3d433fa743f2
parent695e9f71c3f13c1338de5bb653d71462a6e436b8 (diff)
downloademacs-ecf500b5e34f3767df6b41f110efcf307c74ebc9.tar.gz
emacs-ecf500b5e34f3767df6b41f110efcf307c74ebc9.zip
Handle relative file names in vc-resynch-window and vc-resynch-buffer
* lisp/vc/vc-dispatcher.el (vc-resynch-window, vc-resynch-buffer): While comparing with `buffer-file-name' if `file' is not absolute use `expand-file-name' in `vc-root-dir'. This fixes the case of refreshing the buffers after typing `C-x v = C-x v u' (bug#60897).
-rw-r--r--lisp/vc/vc-dispatcher.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index e1a3eff448d..fd5f655a0f6 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -608,7 +608,10 @@ reverting. NOQUERY should be t *only* if it is known the only
608difference between the buffer and the file is due to 608difference between the buffer and the file is due to
609modifications by the dispatcher client code, rather than user 609modifications by the dispatcher client code, rather than user
610editing!" 610editing!"
611 (and (string= buffer-file-name file) 611 (and (string= buffer-file-name
612 (if (file-name-absolute-p file)
613 file
614 (expand-file-name file (vc-root-dir))))
612 (if keep 615 (if keep
613 (when (file-exists-p file) 616 (when (file-exists-p file)
614 (when reset-vc-info 617 (when reset-vc-info
@@ -643,7 +646,10 @@ editing!"
643 646
644(defun vc-resynch-buffer (file &optional keep noquery reset-vc-info) 647(defun vc-resynch-buffer (file &optional keep noquery reset-vc-info)
645 "If FILE is currently visited, resynch its buffer." 648 "If FILE is currently visited, resynch its buffer."
646 (if (string= buffer-file-name file) 649 (if (string= buffer-file-name
650 (if (file-name-absolute-p file)
651 file
652 (expand-file-name file (vc-root-dir))))
647 (vc-resynch-window file keep noquery reset-vc-info) 653 (vc-resynch-window file keep noquery reset-vc-info)
648 (if (file-directory-p file) 654 (if (file-directory-p file)
649 (vc-resynch-buffers-in-directory file keep noquery reset-vc-info) 655 (vc-resynch-buffers-in-directory file keep noquery reset-vc-info)