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 <manikulin@gmail.com>
Link: https://orgmode.org/list/uue18j$j42$1@ciao.gmane.io
This commit is contained in:
Ihor Radchenko 2024-04-01 14:04:50 +03:00
parent 4c902d4771
commit 1d86651bef
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 2 deletions

View File

@ -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)))