# HG changeset patch # User Richard M. Stallman # Date 872458101 0 # Node ID 9f6b375ce842284dd7c54d608b78a68feb74fcf0 # Parent f29538ec7ca131b657abc8dbf59a54be78345913 (eval-expression): Prefix arg means insert value in current buffer. diff -r f29538ec7ca1 -r 9f6b375ce842 lisp/simple.el --- a/lisp/simple.el Sun Aug 24 20:49:32 1997 +0000 +++ b/lisp/simple.el Sun Aug 24 21:28:21 1997 +0000 @@ -514,15 +514,18 @@ ;; 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.