[Emacs] Add advice functions for eros

This commit is contained in:
Ivan Malison 2016-12-29 17:01:13 -08:00
parent 6358ccc6e7
commit dbe968312a
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -2500,6 +2500,19 @@ Reduce indentation for some functions
:commands (eros-mode) :commands (eros-mode)
:preface :preface
(progn (progn
(defun eros-around-eval-last-sexp (fn &rest args)
(eros--eval-overlay (apply fn args) (point)))
(defun eros-around-eval-defun (fn &rest args)
(eros--eval-overlay
(apply fn args)
(save-excursion
(end-of-defun)
(point))))
(advice-add 'eval-defun :around 'eros-around-eval-defun)
(advice-add 'eval-last-sexp :around 'eros-around-eval-last-sexp)
(add-hook 'emacs-lisp-mode-hook 'eros-mode))) (add-hook 'emacs-lisp-mode-hook 'eros-mode)))
#+END_SRC #+END_SRC
**** Reevalute defvars when running eval-last-sexp **** Reevalute defvars when running eval-last-sexp