branch: externals/denote
commit ed0fcb0ebfa12672934b0aaa914c5c1825274876
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make denote-grep-file-regexp-prompt return a string, not assuming it is 
part of 'interactive'
    
    This is how we do it with all our prompts. In practice, it is used in
    an interactive spec though it might be used outside of one (also
    considering how users may choose to use our functions).
    
    This builds on top of commit f70c96c, which was contributed by Lucas
    Quintana in pull request 571: 
<https://github.com/protesilaos/denote/pull/571>.
    
    Lucas has assigned copyright to the Free Software Foundation.
---
 denote.el | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/denote.el b/denote.el
index d9b72068d2..0569da315d 100644
--- a/denote.el
+++ b/denote.el
@@ -5281,14 +5281,12 @@ Also see `denote-grep-history'.")
   "Prompt for a file regexp in the minibuffer.
 
 The prompt assumes the user wants to exclude files, unless INCLUDE is
-non-nil.
-
-Returned value is a list in order to be used in an `interactive' spec."
-  (list (read-string
-         (if (not include)
-             "Exclude file names matching: "
-           "Only include file names matching: ")
-         nil 'denote-grep-file-regexp-history)))
+non-nil."
+  (read-string
+   (if (not include)
+       "Exclude file names matching: "
+     "Only include file names matching: ")
+   nil 'denote-grep-file-regexp-history))
 
 (defun denote-grep-keywords-prompt (&optional include)
   "Prompt for keywords to filter in the minibuffer, with completion.
@@ -5354,7 +5352,7 @@ a list of fixed strings (NOT regexps) to check against 
last matched
 files.  Files that match any of the strings get excluded.  Internally,
 the list is processed using `regexp-opt'.  For an example of this usage,
 see `denote-grep-exclude-files-with-keywords'."
-  (interactive (denote-grep-file-regexp-prompt))
+  (interactive (list (denote-grep-file-regexp-prompt)))
   (let (final-files)
     (dolist (file denote-query--last-files)
       (unless (string-match
@@ -5374,7 +5372,7 @@ see `denote-grep-exclude-files-with-keywords'."
 
 See `denote-grep-exclude-files' for details, including the behaviour
 when REGEXP is a list."
-  (interactive (denote-grep-file-regexp-prompt :include))
+  (interactive (list (denote-grep-file-regexp-prompt :include)))
   (let (final-files)
     (dolist (file denote-query--last-files)
       (when (string-match

Reply via email to