Improve prelude-eval-and-replace
This commit is contained in:
parent
86ba702f48
commit
fa6795b71f
1 changed files with 3 additions and 6 deletions
|
@ -297,12 +297,9 @@ there's a region, all lines that region covers will be duplicated."
|
||||||
(defun prelude-eval-and-replace ()
|
(defun prelude-eval-and-replace ()
|
||||||
"Replace the preceding sexp with its value."
|
"Replace the preceding sexp with its value."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(let ((value (eval (preceding-sexp))))
|
||||||
(backward-kill-sexp)
|
(backward-kill-sexp)
|
||||||
(condition-case nil
|
(insert (format "%s" value))))
|
||||||
(prin1 (eval (read (current-kill 0)))
|
|
||||||
(current-buffer))
|
|
||||||
(error (message "Invalid expression")
|
|
||||||
(insert (current-kill 0)))))
|
|
||||||
|
|
||||||
(defun prelude-recompile-init ()
|
(defun prelude-recompile-init ()
|
||||||
"Byte-compile all your dotfiles again."
|
"Byte-compile all your dotfiles again."
|
||||||
|
|
Loading…
Reference in a new issue