emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote e2ba6c144d 16/20: Guard sorting keywords when gi


From: ELPA Syncer
Subject: [elpa] externals/denote e2ba6c144d 16/20: Guard sorting keywords when given an empty string
Date: Wed, 20 Dec 2023 03:58:02 -0500 (EST)

branch: externals/denote
commit e2ba6c144d376548c072c4f7f9452ad22b78bb57
Author: Ashton Wiersdorf <mail@wiersdorf.dev>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    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
---
 denote.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 89b2b276a3..a99d02de07 100644
--- a/denote.el
+++ b/denote.el
@@ -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))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]