branch: externals/denote
commit 19a0566e07bcb8e169afdfcdc550cf9d1459e60d
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Use helper function to prompt for regexp in denote-org-dblock.el
---
 denote-org-dblock.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/denote-org-dblock.el b/denote-org-dblock.el
index 1244ff0895..ebb30e084a 100644
--- a/denote-org-dblock.el
+++ b/denote-org-dblock.el
@@ -42,12 +42,14 @@
 
 ;;;; Dynamic block to insert links
 
+(defun denote-org-dblock--file-regexp-prompt ()
+  "Prompt for regexp to match Denote file names."
+  (read-regexp "Search for notes matching REGEX: " nil 
'denote-link--add-links-history))
+
 ;;;###autoload
 (defun denote-org-dblock-insert-links (regexp)
   "Create Org dynamic block to insert Denote links matching REGEXP."
-  (interactive
-    (list
-     (read-regexp "Search for notes matching REGEX: " nil 
'denote-link--add-links-history)))
+  (interactive (list (denote-org-dblock--file-regexp-prompt)))
   (org-create-dblock (list :name "denote-links"
                            :regexp regexp
                            :id-only nil))
@@ -158,9 +160,7 @@ as a typographic list."
 ;;;###autoload
 (defun denote-org-dblock-insert-files (regexp)
   "Create Org dynamic block to insert Denote files matching REGEXP."
-  (interactive
-    (list
-     (read-regexp "Search for notes matching REGEX: " nil 
'denote--file-history)))
+  (interactive (list (denote-org-dblock--file-regexp-prompt)))
   (org-create-dblock (list :name "denote-files"
                            :regexp regexp
                            :no-front-matter nil

Reply via email to