branch: externals/denote
commit 54494edf5ab7552e06ed938ad63b20278f63b69c
Author: alvmts <[email protected]>
Commit: GitHub <[email protected]>

    Fix trimming of Org links in `denote-link-ol-follow'
    
    This patch makes it so only search options in Org links get trimmed when 
checking whether the linked file exists.
    
    The old regex erroneously truncates filenames containing a single colon, so 
"/tmp/foo:bar/file.ext" becomes "/tmp/foo".
---
 denote.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 4ce6ea284a..2b37d0d032 100644
--- a/denote.el
+++ b/denote.el
@@ -6849,7 +6849,7 @@ query of file contents or file names (see the commands
 
 Uses the function `denote-directory' to establish the path to the file."
   (if-let* ((match (denote-link--ol-resolve-link-to-target link))
-            (_ (file-exists-p (string-trim-right match ":[^/]+.*"))))
+            (_ (file-exists-p (string-trim-right match ":\\{2\\}.*"))))
       (org-link-open-as-file match nil)
     (denote--act-on-query-link match)))
 

Reply via email to