Avoid keeping opened buffers in denote-link-return-links

This commit is contained in:
Matteo Cavada 2024-02-14 15:16:00 +01:00
parent 1d6ea5a6d9
commit edac33337c

View file

@ -3506,7 +3506,8 @@ Also see `denote-link-return-backlinks'."
((denote-file-has-supported-extension-p current-file))
(file-type (denote-filetype-heuristics current-file))
(regexp (denote--link-in-context-regexp file-type)))
(with-current-buffer (find-file-noselect current-file)
(with-temp-buffer
(insert-file-contents current-file)
(denote-link--expand-identifiers regexp))))
(defalias 'denote-link-return-forelinks 'denote-link-return-links