Permalink
Find file
c3a86d3 Nov 12, 2011
12 lines (10 sloc) 317 Bytes
;; Lisp specific defuns
(defun eval-and-replace ()
"Replace the preceding sexp with its value."
(interactive)
(backward-kill-sexp)
(condition-case nil
(prin1 (eval (read (current-kill 0)))
(current-buffer))
(error (message "Invalid expression")
(insert (current-kill 0)))))