branch: externals/denote commit 272e93941745a45ec74391d65371b61ee9a7af0d Merge: 3dc772f683 d3a8582c91 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: GitHub <nore...@github.com>
Merge pull request #617 from jeanphilippegg/fix-renaming-command Fix denote--rename-file for files without an identifier --- denote.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/denote.el b/denote.el index 3ca404a304..f06e06626a 100644 --- a/denote.el +++ b/denote.el @@ -4081,7 +4081,7 @@ Respect `denote-rename-confirmations', `denote-save-buffers' and identifier)) (identifier (cond ((string-empty-p identifier) identifier) ((string= old-identifier identifier) identifier) - ((denote--file-has-backlinks-p file) + ((and (not (string-empty-p old-identifier)) (denote--file-has-backlinks-p file)) (user-error "The identifier cannot be modified because the new identifier has backlinks")) (t (funcall denote-get-identifier-function identifier nil)))) (new-name (denote-format-file-name directory identifier keywords title extension signature))