diff options
| author | Juri Linkov | 2019-11-07 01:14:58 +0200 |
|---|---|---|
| committer | Juri Linkov | 2019-11-07 01:14:58 +0200 |
| commit | deb61da7a27698ddc0b95ba92d18c20f533bb802 (patch) | |
| tree | 2309fc8637f80d5ba4607f8a5527555e860248d0 /lisp/vc | |
| parent | 528485d0172f00e5f0c8ea548013a49964be501b (diff) | |
| download | emacs-deb61da7a27698ddc0b95ba92d18c20f533bb802.tar.gz emacs-deb61da7a27698ddc0b95ba92d18c20f533bb802.zip | |
* lisp/dired-aux.el (dired-vc-rename-file): New defcustom.
(dired-rename-file): Call vc-rename-file when dired-vc-rename-file is non-nil.
* lisp/vc/vc.el (vc-rename-file): Allow renaming added files.
Call vc-file-clearprops on new file too for the case when
old and new files were renamed to each other back and forth.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00069.html
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/vc.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c982b0220e3..20056dec7f9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -2913,11 +2913,12 @@ current buffer's file name if it's under version control." | |||
| 2913 | (when (file-exists-p new) | 2913 | (when (file-exists-p new) |
| 2914 | (error "New file already exists")) | 2914 | (error "New file already exists")) |
| 2915 | (let ((state (vc-state old))) | 2915 | (let ((state (vc-state old))) |
| 2916 | (unless (memq state '(up-to-date edited)) | 2916 | (unless (memq state '(up-to-date edited added)) |
| 2917 | (error "Please %s files before moving them" | 2917 | (error "Please %s files before moving them" |
| 2918 | (if (stringp state) "check in" "update")))) | 2918 | (if (stringp state) "check in" "update")))) |
| 2919 | (vc-call rename-file old new) | 2919 | (vc-call rename-file old new) |
| 2920 | (vc-file-clearprops old) | 2920 | (vc-file-clearprops old) |
| 2921 | (vc-file-clearprops new) | ||
| 2921 | ;; Move the actual file (unless the backend did it already) | 2922 | ;; Move the actual file (unless the backend did it already) |
| 2922 | (when (file-exists-p old) (rename-file old new)) | 2923 | (when (file-exists-p old) (rename-file old new)) |
| 2923 | ;; ?? Renaming a file might change its contents due to keyword expansion. | 2924 | ;; ?? Renaming a file might change its contents due to keyword expansion. |