Make eval-region-or-defun work with elpaca

This commit is contained in:
David Morgan 2023-06-01 16:20:34 +01:00
parent 97cca71d0b
commit 4926c3d2c0
Signed by: djm
GPG Key ID: C171251002C200F2
1 changed files with 5 additions and 2 deletions

View File

@ -15,8 +15,11 @@
"Call eval-region, if one is selected, or eval-defun otherwise." "Call eval-region, if one is selected, or eval-defun otherwise."
(interactive "P") (interactive "P")
(if (use-region-p) (if (use-region-p)
(eval-region (region-beginning) (region-end)) ;; Set `this-command', otherwise elpaca does not work correctly
(eval-defun edebug-it))) (let ((this-command 'eval-region))
(eval-region (region-beginning) (region-end)))
(let ((this-command 'eval-defun))
(eval-defun edebug-it))))
;; Based on prelude-emacs-lisp.el ;; Based on prelude-emacs-lisp.el
(defun recompile-init-lisp () (defun recompile-init-lisp ()
"Recompile elisp files in `user-emacs-directory/lisp'." "Recompile elisp files in `user-emacs-directory/lisp'."