Document denote-rename-file-identifier behaviour about not breaking backlinks

Thanks to jarofromel for pointing out that the documentation and error
message could be improved. This was done in issue 646:
<https://github.com/protesilaos/denote/issues/646>.
This commit is contained in:
Protesilaos Stavrou 2025-11-01 07:45:13 +02:00
parent c4cb46f592
commit 9f1042f4f6
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -4262,7 +4262,7 @@ Respect `denote-rename-confirmations', `denote-save-buffers' and
(identifier (cond ((string-empty-p identifier) identifier)
((string= old-identifier identifier) identifier)
((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"))
(user-error "The identifier cannot be modified: that will break existing links"))
(t (funcall denote-get-identifier-function identifier nil))))
(new-name (denote-format-file-name directory identifier keywords title extension signature))
(max-mini-window-height denote-rename-max-mini-window-height))
@ -4516,6 +4516,9 @@ minibuffer prompt with the existing identifier. The user can then modify
it accordingly. An empty input means to remove the identifier
altogether.
An identifier that is already used in links cannot be modified,
otherwise all links will break.
Please check the documentation of `denote-rename-file' with regard to
how a completion User Interface may accept an empty input."
(declare (interactive-only t))