[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 ecf500b5e34: Handle relative file names in vc-resynch-window an
From: |
Juri Linkov |
Subject: |
emacs-29 ecf500b5e34: Handle relative file names in vc-resynch-window and vc-resynch-buffer |
Date: |
Tue, 24 Jan 2023 13:48:57 -0500 (EST) |
branch: emacs-29
commit ecf500b5e34f3767df6b41f110efcf307c74ebc9
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
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).
---
lisp/vc/vc-dispatcher.el | 10 ++++++++--
1 file 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
difference between the buffer and the file is due to
modifications by the dispatcher client code, rather than user
editing!"
- (and (string= buffer-file-name file)
+ (and (string= buffer-file-name
+ (if (file-name-absolute-p file)
+ file
+ (expand-file-name file (vc-root-dir))))
(if keep
(when (file-exists-p file)
(when reset-vc-info
@@ -643,7 +646,10 @@ editing!"
(defun vc-resynch-buffer (file &optional keep noquery reset-vc-info)
"If FILE is currently visited, resynch its buffer."
- (if (string= buffer-file-name file)
+ (if (string= buffer-file-name
+ (if (file-name-absolute-p file)
+ file
+ (expand-file-name file (vc-root-dir))))
(vc-resynch-window file keep noquery reset-vc-info)
(if (file-directory-p file)
(vc-resynch-buffers-in-directory file keep noquery reset-vc-info)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 ecf500b5e34: Handle relative file names in vc-resynch-window and vc-resynch-buffer,
Juri Linkov <=