Prevent infinite recursion opening legacy pdf links

This commit is contained in:
Henrik Lissner 2020-04-16 18:27:38 -04:00
parent f532019b1f
commit ccec354739
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -825,7 +825,8 @@ compelling reason, so..."
(add-hook! 'org-open-link-functions
(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)
(org-link-open (replace-regexp-in-string regexp "pdf:" link))
t))))