branch: externals/denote
commit f2ff5efaddcfcd68e5b430b18f1914311f85ed4a
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Reinstate support for vc-rename-file in denote-rename-file-and-buffer
---
denote.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/denote.el b/denote.el
index d0dc37c29f..f863ad6826 100644
--- a/denote.el
+++ b/denote.el
@@ -2471,13 +2471,12 @@ variable `denote-directory'."
(cond
((derived-mode-p 'dired-mode)
(dired-rename-file old-name new-name nil))
- ;; FIXME 2023-11-03: The `vc-rename-file' requires the file to be
+ ;; NOTE 2024-02-25: The `vc-rename-file' requires the file to be
;; saved, but our convention is to not save the buffer after
;; changing front matter unless we absolutely have to (allows
;; users to do `diff-buffer-with-file', for example).
-
- ;; ((vc-backend old-name)
- ;; (vc-rename-file old-name new-name))
+ ((and denote-save-buffer-after-creation (not (buffer-modified-p))
(vc-backend old-name))
+ (vc-rename-file old-name new-name))
(t
(rename-file old-name new-name nil)))
(when-let ((buffer (find-buffer-visiting old-name)))