fix(emacs-lisp): set doom-module-context in eval handler

So module context is in scope of evaluated code.

Amend: 4efaf6837b
This commit is contained in:
Henrik Lissner 2022-09-25 16:47:06 +02:00
parent 5222612527
commit 156fade7e2
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -13,7 +13,10 @@ to a pop up buffer."
(debug-on-error t))
(unwind-protect
(condition-case-unless-debug e
(let ((doom--current-module (ignore-errors (doom-module-from-path buffer-file-name))))
(doom-module-context-with
(doom-module-from-path
(or (buffer-file-name (buffer-base-buffer))
default-directory))
(doom-context-with 'eval
(eval-region beg end buffer load-read-function))
(with-current-buffer buffer