[Emacs] Don't add eros advice until eros is loaded

This commit is contained in:
Ivan Malison 2016-12-30 12:50:24 -08:00
parent fd57bc0a61
commit 66dd405041
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -2504,6 +2504,10 @@ Reduce indentation for some functions
#+BEGIN_SRC emacs-lisp
(use-package eros
:commands (eros-mode)
:config
(progn
(advice-add 'eval-defun :around 'eros-around-eval-defun)
(advice-add 'eval-last-sexp :around 'eros-around-eval-last-sexp))
:preface
(progn
(defun eros-around-eval-last-sexp (fn &rest args)
@ -2516,9 +2520,6 @@ Reduce indentation for some functions
(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