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

    Make the denote-file-prompt 'let' bind the default-directory
    
    This way, any other function that needs to derive the file path from
    the completion candidates will do it correctly.
    
    I discovered this by discussing with Alan Schmitt an issue involving
    the Embark package. This was done in discussion 524:
    <https://github.com/protesilaos/denote/discussions/524>.
---
 denote.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 02d33749dc..e3b1061a17 100644
--- a/denote.el
+++ b/denote.el
@@ -1430,7 +1430,8 @@ select a file.
 With optional NO-REQUIRE-MATCH, accept the given input as-is.
 
 Return the absolute path to the matching file."
-  (let* ((relative-files (mapcar 
#'denote-get-file-name-relative-to-denote-directory
+  (let* ((default-directory (denote-directory))
+         (relative-files (mapcar 
#'denote-get-file-name-relative-to-denote-directory
                                  (denote-directory-files files-matching-regexp 
:omit-current)))
          (prompt (format "%s in %s: "
                          (or prompt-text "Select FILE")

Reply via email to