branch: externals/denote commit a3cc59acfe22e0abb2007dc715f95f0d79e58d5e Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Make denote-link-find-file find file reliably The current code works even if the link is stored in a file outside the 'denote-directory'. It works for as long as the target file is in the 'denote-directory'. I discovered this problem while exchanging views with Marc Fargas regarding commit dd086b7: <https://lists.sr.ht/~protesilaos/denote/patches/35137>. --- denote.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/denote.el b/denote.el index 1b43801a6e..eaf8222974 100644 --- a/denote.el +++ b/denote.el @@ -2058,7 +2058,10 @@ format is always [[denote:IDENTIFIER]]." (interactive) (if-let* ((regexp (denote-link--file-type-regexp (buffer-file-name))) (files (denote-link--expand-identifiers regexp))) - (find-file (denote-link--find-file-prompt files)) + (find-file ; TODO 2022-09-05: Revise for possible refinement + (denote--get-note-path-by-id + (denote-link--id-from-string + (denote-link--find-file-prompt files)))) (user-error "No links found in the current buffer"))) ;;;;; Link buttons