mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-15 17:56:19 -04:00
Fix: Handle signature in denote-dired-rename-marked-files-with-keywords
I hit this bug when I called `M-x
denote-dired-rename-marked-files-with-keywords` on the file at point
in a dired buffer. The stack-trace is as follows:
```
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
replace-regexp-in-string("[][{}!@#$%^&*()=+'\"?,.|;:~`‘’“”/]*-" "" nil)
denote--slug-no-punct(nil "-")
denote-sluggify-signature(nil)
denote-dired-rename-marked-files-with-keywords()
```
`denote-sluggify-signature` gets a `nil` input which it cannot handle.
This happens because the signature is extracted using
`denote-retrieve-filename-signature`, which can return a `nil` value.
The fix is to only call `denote-sluggify-signature` when we have a
signature to handle.
This commit is contained in:
parent
4ad77f92dd
commit
dee430a586
|
|
@ -2530,7 +2530,7 @@ Specifically, do the following:
|
|||
(file-type (denote-filetype-heuristics file))
|
||||
(title (denote--retrieve-title-or-filename file file-type))
|
||||
(extension (denote-get-file-extension file))
|
||||
(new-name (denote-format-file-name dir id keywords (denote-sluggify title 'title) extension (denote-sluggify-signature signature))))
|
||||
(new-name (denote-format-file-name dir id keywords (denote-sluggify title 'title) extension (when signature (denote-sluggify-signature signature)))))
|
||||
(denote-rename-file-and-buffer file new-name)
|
||||
(when (denote-file-is-writable-and-supported-p new-name)
|
||||
(if (denote--edit-front-matter-p new-name file-type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue