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".
This commit is contained in:
alvmts 2026-01-01 01:39:22 -05:00 committed by GitHub
parent a576d8917c
commit 54494edf5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)))