eval-and-replace function added
This commit is contained in:
parent
b80c53b5c0
commit
45ea6e1e4a
|
@ -12,6 +12,18 @@
|
|||
"Tested with v0.6.1. Extracted from `yas/expand-1'"
|
||||
(first (yas/current-key)))
|
||||
|
||||
|
||||
(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)))))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun extension/development-initialize ()
|
||||
"Development plugin initialization."
|
||||
|
|
Loading…
Reference in New Issue