From ccec3547392d34b854ad18d3c5c4790009ed83ac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 16 Apr 2020 18:27:38 -0400 Subject: [PATCH] Prevent infinite recursion opening legacy pdf links --- modules/lang/org/config.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 475b74743..956851582 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -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))))