aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-24 21:28:21 +0000
committerRichard M. Stallman1997-08-24 21:28:21 +0000
commitecb7ad00485adc5160411650ac7514dff9b3b8d9 (patch)
tree42edd37b2c73dfa2c3b74c720fe33324c8a51842
parentb87fe54b9ffc386d3b1bf3963ae162fbdbaec2c9 (diff)
downloademacs-ecb7ad00485adc5160411650ac7514dff9b3b8d9.tar.gz
emacs-ecb7ad00485adc5160411650ac7514dff9b3b8d9.zip
(eval-expression): Prefix arg means insert value in current buffer.
-rw-r--r--lisp/simple.el9
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."
514 514
515;; We define this, rather than making `eval' interactive, 515;; We define this, rather than making `eval' interactive,
516;; for the sake of completion of names like eval-region, eval-current-buffer. 516;; for the sake of completion of names like eval-region, eval-current-buffer.
517(defun eval-expression (eval-expression-arg) 517(defun eval-expression (eval-expression-arg
518 &optional eval-expression-insert-value)
518 "Evaluate EXPRESSION and print value in minibuffer. 519 "Evaluate EXPRESSION and print value in minibuffer.
519Value is also consed on to front of the variable `values'." 520Value is also consed on to front of the variable `values'."
520 (interactive 521 (interactive
521 (list (read-from-minibuffer "Eval: " 522 (list (read-from-minibuffer "Eval: "
522 nil read-expression-map t 523 nil read-expression-map t
523 'read-expression-history))) 524 'read-expression-history)
525 current-prefix-arg))
524 (setq values (cons (eval eval-expression-arg) values)) 526 (setq values (cons (eval eval-expression-arg) values))
525 (prin1 (car values) t)) 527 (prin1 (car values)
528 (if eval-expression-insert-value (current-buffer) t)))
526 529
527(defun edit-and-eval-command (prompt command) 530(defun edit-and-eval-command (prompt command)
528 "Prompting with PROMPT, let user edit COMMAND and eval result. 531 "Prompting with PROMPT, let user edit COMMAND and eval result.