From dbe968312a67b9c5dfaa54e2d9a6f67afa51383b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 29 Dec 2016 17:01:13 -0800 Subject: [PATCH] [Emacs] Add advice functions for eros --- dotfiles/emacs.d/README.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 5dbee9f8..4328aaee 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2500,6 +2500,19 @@ Reduce indentation for some functions :commands (eros-mode) :preface (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))) #+END_SRC **** Reevalute defvars when running eval-last-sexp