[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 234520b9d7 1/3: Fix file renaming when using ver
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 234520b9d7 1/3: Fix file renaming when using version control |
Date: |
Tue, 18 Oct 2022 08:57:38 -0400 (EDT) |
branch: externals/denote
commit 234520b9d7aac866d0be32c3bb9aaa3a04dd5a00
Author: Florian <florian.denote@aboulafia.org>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Fix file renaming when using version control
If dired-vc-rename-file is set to t, renaming a file under version
control with Denote in a Dired buffer will rename the file using
version control (e.g. "git mv")
---
denote.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index 9a9e8c0204..06a9649437 100644
--- a/denote.el
+++ b/denote.el
@@ -1697,7 +1697,9 @@ the file type is assumed to be the first of
`denote-file-types'."
(defun denote-rename-file-and-buffer (old-name new-name)
"Rename file named OLD-NAME to NEW-NAME, updating buffer name."
(unless (string= (expand-file-name old-name) (expand-file-name new-name))
- (rename-file old-name new-name nil)
+ (if (derived-mode-p 'dired-mode)
+ (dired-rename-file old-name new-name nil)
+ (rename-file old-name new-name nil))
(denote--rename-buffer old-name new-name)))
(define-obsolete-function-alias