emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pp-eval-expression broken


From: Richard Stallman
Subject: Re: pp-eval-expression broken
Date: Fri, 05 Jan 2007 21:55:15 -0500

The reason for the change in pp-eval-expression
is so that it will use read-expression-map and
read-expression-history.  There is no clean way to make
(interactive "x") use them.

If this change causes trouble, we could create a new command with the
new meaning of pp-eval-expression, and document that for users; then
we could put pp-eval-expression back the old way, just for Lisp
callers.


*** pp.el       03 Nov 2006 09:45:00 -0500      1.30
--- pp.el       05 Jan 2007 18:29:41 -0500      
***************
*** 97,107 ****
    (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."
--- 97,107 ----
    (princ (pp-to-string object) (or stream standard-output)))
  
  ;;;###autoload
! (defun pp-eval (expval)
!   "Pretty-print the value of an expression into a new buffer.
! If it fits on one line, display it in the echo area instead.
! Also add the value, EXPVAL, to the front of the list in the
! variable `values'.
  
  Non-interactively, the argument is the value, EXPVAL, not the expression
  to evaluate."
***************
*** 139,144 ****
--- 139,152 ----
        (set (make-local-variable 'font-lock-verbose) nil)))))
  
  ;;;###autoload
+ (defun pp-eval-expression (expression)
+   "Evaluate EXPRESSION and pretty-print its value.
+ This function exists for compatibility with callers in Lisp code.
+ For interactive use, `pp-eval' should be more convenient."
+   (interactive "xPp-eval-expression: ")
+   (pp-eval (eval expression)))
+ 
+ ;;;###autoload
  (defun pp-eval-last-sexp (arg)
    "Run `pp-eval-expression' on sexp before point (which see).
  With argument, pretty-print output into current buffer.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]