fix(direnv): fix void function error in emacs30

This commit is contained in:
StrawberryTea 2024-04-16 03:29:36 -05:00 committed by Yann Esposito (Yogsototh)
parent b121be1c90
commit b4a5fac56a
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -15,7 +15,9 @@
;; hooks, but not the body.
(add-hook! 'envrc-global-mode-hook
(defun +direnv-init-global-mode-earlier-h ()
(let ((fn #'envrc-global-mode-enable-in-buffers))
(let ((fn (if (fboundp #'envrc-global-mode-enable-in-buffers)
#'envrc-global-mode-enable-in-buffers ; Removed in Emacs 30.
#'envrc-global-mode-enable-in-buffer)))
(if (not envrc-global-mode)
(remove-hook 'change-major-mode-after-body-hook fn)
(remove-hook 'after-change-major-mode-hook fn)