diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-24 21:28:21 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-24 21:28:21 +0000 |
commit | c0cccf8ddbd69cd4c1adef8a1fd34b9456e48c38 (patch) | |
tree | 25b6229162f18a1c20589793972185a5e41e0c4c /lisp | |
parent | 3eb56249ab7033b682270efbddbf0e853bfdf4a4 (diff) | |
download | emacs-c0cccf8ddbd69cd4c1adef8a1fd34b9456e48c38.tar.gz |
(eval-expression): Prefix arg means insert value in current buffer.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/simple.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index aa9fa97aeaa..798a706886e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -514,15 +514,18 @@ Other major modes are defined by comparison with this one." ;; We define this, rather than making `eval' interactive, ;; for the sake of completion of names like eval-region, eval-current-buffer. -(defun eval-expression (eval-expression-arg) +(defun eval-expression (eval-expression-arg + &optional eval-expression-insert-value) "Evaluate EXPRESSION and print value in minibuffer. Value is also consed on to front of the variable `values'." (interactive (list (read-from-minibuffer "Eval: " nil read-expression-map t - 'read-expression-history))) + 'read-expression-history) + current-prefix-arg)) (setq values (cons (eval eval-expression-arg) values)) - (prin1 (car values) t)) + (prin1 (car values) + (if eval-expression-insert-value (current-buffer) t))) (defun edit-and-eval-command (prompt command) "Prompting with PROMPT, let user edit COMMAND and eval result. |