Skip to content

Instantly share code, notes, and snippets.

@krisajenkins
Last active December 21, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisajenkins/6269648 to your computer and use it in GitHub Desktop.
Save krisajenkins/6269648 to your computer and use it in GitHub Desktop.
Add flashy flashing to Emacs eval calls.
(require 'nrepl-eval-sexp-fu)
(setq nrepl-eval-sexp-fu-flash-duration 0.25)
(defadvice lisp-eval-region (around lisp-eval-region-flash activate)
"Flash any calls to lisp-eval-region (and the functions that depend on it, like lisp-eval-defun)."
(let* ((start (ad-get-arg 0))
(end (ad-get-arg 1))
(flasher (nrepl-eval-sexp-fu-flash (cons start end)))
(hi (cadr flasher))
(unhi (caddr flasher)))
(nrepl-eval-sexp-fu-flash-doit-simple '(lambda () ad-do-it) hi unhi)))
M-x package-install RET nrepl-eval-sexp-fu
@krisajenkins
Copy link
Author

Some might call this mere eye candy, but I actually find the visual feedback very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment