Skip to content

Commit

Permalink
perf(lib): dir!: unset file-name-handler-alist
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hlissner authored and SadSock committed Feb 22, 2023
1 parent 7cc4744 commit ba0326f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/doom-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."

(defmacro dir! ()
"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...
(defalias 'letenv! 'with-environment-variables)
Expand Down

0 comments on commit ba0326f

Please sign in to comment.