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.
This commit is contained in:
Henrik Lissner 2022-08-08 22:03:19 +02:00
parent 1d8c61698b
commit b763c5b992
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

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