From b763c5b992cc5450899e5b2d9f29f94c1c918784 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 8 Aug 2022 22:03:19 +0200 Subject: [PATCH] fix: file-name-handler-alist ignoring user changes Unsetting file-name-handler-alist around a `load` call prevents any change to this variable from surviving that file's evaluation (e.g. by packages loaded therein). Since the user's config files are loaded with this macro, this affects users' configs, which is unacceptable. Since this optimization is already done in early-init.el, we can get away with being more selective here. --- lisp/doom-lib.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index 2f41b93ee..3a6ba27bc 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -569,11 +569,11 @@ If NOERROR is non-nil, don't throw an error if the file doesn't exist." (error "Could not detect path to look for '%s' in" filename))) (file (if path - `(expand-file-name ,filename ,path) + `(let (file-name-handler-alist) + (expand-file-name ,filename ,path)) filename))) `(condition-case-unless-debug e - (let (file-name-handler-alist) - (load ,file ,noerror 'nomessage)) + (load ,file ,noerror 'nomessage) (doom-error (signal (car e) (cdr e))) (error (doom--handle-load-error e ,file ,path)))))