Created
May 24, 2013 15:24
-
-
Save cbilson/5644295 to your computer and use it in GitHub Desktop.
Sometimes I want to repeat the last eval when I have moved on to another location. Maybe there is a better way to do this, but I wanted to try using advice (1st time.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar *nrepl-last-eval-form* nil) | |
(defadvice nrepl-interactive-eval (after nrepl-remember-last-expression-eval (&optional form)) | |
"Save the last expression evaluated so we can run it again later if we want." | |
(setq *nrepl-last-eval-form* form)) | |
(ad-activate 'nrepl-interactive-eval) | |
(defun nrepl-repeat-interactive-eval () | |
(interactive) | |
(if *nrepl-last-eval-form* | |
(nrepl-interactive-eval *nrepl-last-eval-form*))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment