From 1d86651bef99e7e2ba30af665056f78f4282820a Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 1 Apr 2024 14:04:50 +0300 Subject: [PATCH] org--collect-keywords-1: Ignore #+SETUPFILE when its file handler errs * lisp/org.el (org--collect-keywords-1): When `expand-file-name' handler errs on #+SETUPFILE, ignore it. An error may be thrown when by custom file handler (for example, by TRAMP handler on GVFS path when `tramp-gvfs-enabled' is nil; which is the default). Reported-by: Max Nikulin Link: https://orgmode.org/list/uue18j$j42$1@ciao.gmane.io --- lisp/org.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index da539d939..9cf073368 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4508,8 +4508,11 @@ directory." (uri-is-url (org-url-p uri)) (uri (if uri-is-url uri - (expand-file-name uri)))) - (unless (member uri files) + ;; In case of error, be safe. + ;; See bug#68976. + (ignore-errors ; return nil when expansion fails. + (expand-file-name uri))))) + (unless (or (not uri) (member uri files)) (with-temp-buffer (unless uri-is-url (setq default-directory (file-name-directory uri)))