mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-15 09:46:24 -04:00
don't try to find forward links in non-text files
If a file extension is not in 'denote-file-types', we have no way of parsing or finding outgoing links in it. This change checks for the file extension early on in 'when-let*' block and avoids opening the file which is a relatively costly operation (and would fail finding links anyway).
This commit is contained in:
parent
5b395c2d98
commit
7dc8f4bf7b
|
|
@ -2849,6 +2849,7 @@ whitespace-only), insert an ID-ONLY link."
|
|||
"Return list of links in current or optional FILE.
|
||||
Also see `denote-link-return-backlinks'."
|
||||
(when-let* ((current-file (or file (buffer-file-name)))
|
||||
((denote-file-has-supported-extension-p current-file))
|
||||
(file-type (denote-filetype-heuristics current-file))
|
||||
(regexp (denote--link-in-context-regexp file-type))
|
||||
(links (with-current-buffer (find-file-noselect current-file)
|
||||
|
|
|
|||
Loading…
Reference in a new issue