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

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

[elpa] externals/denote c020d25a21 08/27: Fix denote-link--ol-resolve-li


From: ELPA Syncer
Subject: [elpa] externals/denote c020d25a21 08/27: Fix denote-link--ol-resolve-link-to-target
Date: Sun, 3 Jul 2022 00:57:34 -0400 (EDT)

branch: externals/denote
commit c020d25a21e5b76da86f18780512e57c07b31f23
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Fix denote-link--ol-resolve-link-to-target
    
    Clicking on a link in a note should open the linked note, even if it
    is in a parent directory or a subdirectory.
---
 denote-link.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/denote-link.el b/denote-link.el
index 9b92a24468..83f6026c5a 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -553,11 +553,12 @@ inserts links with just the identifier."
 With optional PATH-ID return a cons cell consisting of the path
 and the identifier."
   (let* ((search (and (string-match "::\\(.*\\)\\'" link)
-                             (match-string 1 link)))
-            (id (if (and (stringp search) (not (string-empty-p search)))
+                      (match-string 1 link)))
+         (id (if (and (stringp search) (not (string-empty-p search)))
                  (substring link 0 (match-beginning 0))
                link))
-         (path (expand-file-name (file-name-completion id 
(denote-directory)))))
+         (path (cl-find-if (lambda (f) (string-prefix-p id 
(file-name-nondirectory f)))
+                           (denote--directory-files :absolute))))
     (cond
      (path-id
       (cons (format "%s" path) (format "%s" id)))



reply via email to

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