mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-15 09:46:24 -04:00
Guard sorting keywords when given an empty string
I've been using Denote with Transient. However, when `denote' is
invoked non-interactively (as through a transient prefix) and no
keywords are specified, the empty string gets passed to `sort', which
is an error.
I've made a file that can be used with the `elpaca-test' macro from
the excellent Elpaca package manager to reproduce the bug. I've added
it as a paste here:
https://paste.sr.ht/~ashton314/66e2fe76478542c745368e82a8eb5c14af38e448
This commit is contained in:
parent
195f0c3b7f
commit
e2ba6c144d
|
|
@ -1031,7 +1031,7 @@ Return an empty string if the minibuffer input is empty."
|
|||
(defun denote-keywords-sort (keywords)
|
||||
"Sort KEYWORDS if `denote-sort-keywords' is non-nil.
|
||||
KEYWORDS is a list of strings, per `denote-keywords-prompt'."
|
||||
(if denote-sort-keywords
|
||||
(if (and (listp keywords) denote-sort-keywords)
|
||||
(sort keywords #'string-collate-lessp)
|
||||
keywords))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue