Fix Windows compatibility of denote-link-ol-follow

On Windows, given the `link` as an identifer `"20250312T161853"` , the result of `(denote-link--ol-resolve-link-to-target 
 link)` is a Windows path `"c:/path/to/the/file.extension"`

However, the result of `(file-exists-p (string-trim-right match ":.*"))` is `nil`, because `(string-trim-right "c:/path/to/the/file.extension" ":.*")` returns `"c"` ,which is the driver letter on Windows.

We can fix it by this: `(string-trim-right "c:/path/to/the/file.extension" ":[^/]+.*")`
This commit is contained in:
TomoeMami 2025-04-14 13:41:26 +08:00 committed by GitHub
parent 956f5dfd10
commit da64be1a49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6082,7 +6082,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 ":[^/]+.*"))))
(org-link-open-as-file match nil)
(denote--act-on-query-link match)))