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

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

[elpa] externals/denote 45fe76ca24 05/12: Make denote-file-prompt record


From: ELPA Syncer
Subject: [elpa] externals/denote 45fe76ca24 05/12: Make denote-file-prompt record history
Date: Mon, 25 Sep 2023 09:58:15 -0400 (EDT)

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

    Make denote-file-prompt record history
    
    We had a regression when we switched to the project.el prompt whereby
    the history was not being updated.  Or, at least, it was not updated
    while I was using it today.  We thus populate the history variable
    ourselves, though this may not be necessary.  We shall see.
---
 denote.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index 8391a4cdcd..683c2c3630 100644
--- a/denote.el
+++ b/denote.el
@@ -892,13 +892,14 @@ The path is relative to DIRECTORY (default: 
‘default-directory’)."
   "Prompt for file with identifier in variable `denote-directory'.
 With optional FILES-MATCHING-REGEXP, filter the candidates per
 the given regular expression."
-  (let* ((files (if files-matching-regexp
+  (when-let ((files (if files-matching-regexp
                     (denote-directory-files-matching-regexp 
files-matching-regexp)
                   (denote-all-files)))
-         (completion-ignore-case read-file-name-completion-ignore-case))
-    (when files
-      (funcall project-read-file-name-function
-               "Select note: " files nil 'denote--file-history))))
+             (completion-ignore-case read-file-name-completion-ignore-case)
+             (file (funcall project-read-file-name-function
+                            "Select note: " files nil 'denote--file-history)))
+    (add-to-history 'denote--file-history file)
+    file))
 
 (define-obsolete-function-alias
   'denote--retrieve-read-file-prompt



reply via email to

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