Prevent infinite recursion opening legacy pdf links
This commit is contained in:
parent
f532019b1f
commit
ccec354739
1 changed files with 2 additions and 1 deletions
|
@ -825,7 +825,8 @@ compelling reason, so..."
|
||||||
|
|
||||||
(add-hook! 'org-open-link-functions
|
(add-hook! 'org-open-link-functions
|
||||||
(defun +org-open-old-pdf-links-fn (link)
|
(defun +org-open-old-pdf-links-fn (link)
|
||||||
(let ((regexp "^pdf\\(?:tools\\|view\\):"))
|
(let ((regexp "^pdf\\(?:tools\\|view\\):")
|
||||||
|
(org-open-link-functions (remq #'+org-open-old-pdf-links-fn org-open-link-functions)))
|
||||||
(when (string-match-p regexp link)
|
(when (string-match-p regexp link)
|
||||||
(org-link-open (replace-regexp-in-string regexp "pdf:" link))
|
(org-link-open (replace-regexp-in-string regexp "pdf:" link))
|
||||||
t))))
|
t))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue