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

    Make denote-select-from-files-prompt only check for denote-directory once
---
 denote.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index 31e12a5c1d..99edb78130 100644
--- a/denote.el
+++ b/denote.el
@@ -5393,14 +5393,15 @@ selected one.
 
 With optional PROMPT-TEXT use it for the minibuffer prompt instead of
 the generic one."
-  (let* ((file-names (if (denote-has-single-denote-directory-p)
+  (let* ((single-dir-p (denote-has-single-denote-directory-p))
+         (file-names (if single-dir-p
                          (mapcar 
#'denote-get-file-name-relative-to-denote-directory files)
                        files))
          (selected (completing-read
                     (format-prompt (or prompt-text "Select file among files") 
nil)
                     (denote--completion-table 'file file-names)
                     nil t nil 'denote-link-find-file-history)))
-    (if (denote-has-single-denote-directory-p)
+    (if single-dir-p
         (expand-file-name selected (car (denote-directories)))
       selected)))
 

Reply via email to