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

    Make denote-select-linked-file-prompt return absolute path
    
    This extends the work done in commits 266207d, 81e529d.
---
 denote.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index 6afc344695..9d49154038 100644
--- a/denote.el
+++ b/denote.el
@@ -4892,12 +4892,15 @@ the active region specially, is up to it."
   "Compatibility alias for `denote-link-find-file-history'.")
 
 (defun denote-select-linked-file-prompt (files)
-  "Prompt for linked file among FILES."
-  (let ((file-names (mapcar 
#'denote-get-file-name-relative-to-denote-directory files)))
-    (completing-read
-     "Find linked file: "
-     (denote--completion-table 'file file-names)
-     nil t nil 'denote-link-find-file-history)))
+  "Prompt for linked file among FILES.
+Show relative file names and then return the absolute version of the
+selected one."
+  (let* ((file-names (mapcar 
#'denote-get-file-name-relative-to-denote-directory files))
+         (selected (completing-read
+                    "Find linked file: "
+                    (denote--completion-table 'file file-names)
+                    nil t nil 'denote-link-find-file-history)))
+    (expand-file-name selected (denote-directory))))
 
 (define-obsolete-function-alias
   'denote-link--find-file-prompt

Reply via email to