aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1993-07-26 18:32:07 +0000
committerRoland McGrath1993-07-26 18:32:07 +0000
commit8570b0ca3c4182824a5d4757c5b525138ccc5087 (patch)
tree8e209822a48750bdb348ec75a361f569aa75de70
parent934d56b7f1211b6e0053e55149feb53bbbba3bf9 (diff)
downloademacs-8570b0ca3c4182824a5d4757c5b525138ccc5087.tar.gz
emacs-8570b0ca3c4182824a5d4757c5b525138ccc5087.zip
(read-expression-history): New defvar.
(eval-expression): Use it has history var in interactive spec.
-rw-r--r--lisp/simple.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 1a4dfb5a9a7..c697a4c95d0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -375,13 +375,16 @@ Other major modes are defined by comparison with this one."
375 375
376(put 'eval-expression 'disabled t) 376(put 'eval-expression 'disabled t)
377 377
378;; We define this, rather than making eval interactive, 378(defvar read-expression-history nil)
379
380;; We define this, rather than making `eval' interactive,
379;; for the sake of completion of names like eval-region, eval-current-buffer. 381;; for the sake of completion of names like eval-region, eval-current-buffer.
380(defun eval-expression (expression) 382(defun eval-expression (expression)
381 "Evaluate EXPRESSION and print value in minibuffer. 383 "Evaluate EXPRESSION and print value in minibuffer.
382Value is also consed on to front of the variable `values'." 384Value is also consed on to front of the variable `values'."
383 (interactive (list (read-from-minibuffer "Eval: " 385 (interactive (list (read-from-minibuffer "Eval: "
384 nil read-expression-map t))) 386 nil read-expression-map t
387 'read-expression-history)))
385 (setq values (cons (eval expression) values)) 388 (setq values (cons (eval expression) values))
386 (prin1 (car values) t)) 389 (prin1 (car values) t))
387 390