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

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

[elpa] externals/denote c6c3fc95c6: Add optional INITIAL-TEXT to denote-


From: ELPA Syncer
Subject: [elpa] externals/denote c6c3fc95c6: Add optional INITIAL-TEXT to denote-file-prompt
Date: Wed, 5 Oct 2022 10:57:31 -0400 (EDT)

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

    Add optional INITIAL-TEXT to denote-file-prompt
    
    Thanks to Alan Schmitt for suggesting the idea:
    <https://lists.sr.ht/~protesilaos/denote/%3C87pmf676n1.fsf@m4x.org%3E>.
---
 README.org | 3 ++-
 denote.el  | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 07cdf0692a..ceefa66650 100644
--- a/README.org
+++ b/README.org
@@ -2472,7 +2472,8 @@ might change them without further notice.
 
 #+findex: denote-file-prompt
 + Function ~denote-file-prompt~ :: Prompt for file with identifier in
-  variable ~denote-directory~.
+  variable ~denote-directory~.  With optional =INITIAL-TEXT= use it to
+  prepopulate the minibuffer.
 
 #+findex: denote-keywords-prompt
 + Function ~denote-keywords-prompt~ :: Prompt for one or more
diff --git a/denote.el b/denote.el
index 97cf276e6a..454e6303e1 100644
--- a/denote.el
+++ b/denote.el
@@ -645,9 +645,10 @@ value, as explained in its doc string."
   'denote-directory-files-matching-regexp
   "1.0.0")
 
-(defun denote-file-prompt ()
-  "Prompt for file with identifier in variable `denote-directory'."
-  (read-file-name "Select note: " (denote-directory) nil nil nil
+(defun denote-file-prompt (&optional initial-text)
+  "Prompt for file with identifier in variable `denote-directory'.
+With optional INITIAL-TEXT, use it to prepopulate the minibuffer."
+  (read-file-name "Select note: " (denote-directory) nil nil initial-text
                   (lambda (f)
                     (or (denote-file-has-identifier-p f)
                         (file-directory-p f)))))



reply via email to

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