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

    Make 'denote-query' also use the active region
---
 denote.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index f3a2dfbb41..590c503642 100644
--- a/denote.el
+++ b/denote.el
@@ -5372,13 +5372,13 @@ non-nil value."
 
 ;;;###autoload
 (defun denote-query (query)
-  "Create a QUERY link at point.
+  "Create query link at point, prompting for QUERY or using the active region.
 Query links do not point to any file but instead initiate a search in
 the contents of files inside the variable `denote-directory'.  They are
 always formatted as [[denote:QUERY]].  This is unlike what `denote-link'
 and related commands do, which always establish a direct connection to a
 file and their format is more flexible."
-  (interactive (list (denote-query-prompt)))
+  (interactive (list (or (denote--get-active-region-content) 
(denote-query-prompt))))
   (denote--delete-active-region-content)
   (insert (format "[[denote:%s]]" query)))
 

Reply via email to