Mercurial > emacs
changeset 75173:4e312c5cf360
(pp-eval-expression): Once again eval the argument, but read it as `X' does.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 10 Jan 2007 01:14:16 +0000 |
parents | 24c1f680a7fa |
children | 5fb06d3ea025 |
files | lisp/emacs-lisp/pp.el |
diffstat | 1 files changed, 7 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/pp.el Wed Jan 10 00:47:16 2007 +0000 +++ b/lisp/emacs-lisp/pp.el Wed Jan 10 01:14:16 2007 +0000 @@ -97,16 +97,13 @@ (princ (pp-to-string object) (or stream standard-output))) ;;;###autoload -(defun pp-eval-expression (expval) - "Evaluate an expression, then pretty-print value EXPVAL into a new buffer. -If pretty-printed EXPVAL fits on one line, display it in the echo -area instead. Also add EXPVAL to the front of the list -in the variable `values'. - -Non-interactively, the argument is the value, EXPVAL, not the expression -to evaluate." - (interactive "XPp-eval: ") - (setq values (cons expval values)) +(defun pp-eval-expression (expression) + "Evaluate EXPRESSION and pretty-print its value. +Also add the value to the front of the list in the variable `values'." + (interactive + (list (read-from-minibuffer "Eval: " nil read-expression-map t + 'read-expression-history))) + (setq values (cons (eval expression) values)) (let* ((old-show-function temp-buffer-show-function) ;; Use this function to display the buffer. ;; This function either decides not to display it at all