perf(lib): dir!: unset file-name-handler-alist

file-name-directory consults this variable for alternative strategies,
which is unnecessary work. (file!) won't (and should never be used in
any context where it could) return anything but a simple file path.
This commit is contained in:
Henrik Lissner 2023-02-21 03:24:58 -05:00
parent 25611707ed
commit 986573a4a2
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -303,7 +303,8 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
(defmacro dir! () (defmacro dir! ()
"Return the directory of the file this macro was called." "Return the directory of the file this macro was called."
(file-name-directory (macroexpand '(file!)))) (let (file-name-handler-alist)
(file-name-directory (macroexpand '(file!)))))
;; REVIEW Should I deprecate this? The macro's name is so long... ;; REVIEW Should I deprecate this? The macro's name is so long...
(defalias 'letenv! 'with-environment-variables) (defalias 'letenv! 'with-environment-variables)