unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: pp-eval-expression broken
Date: Fri, 05 Jan 2007 21:55:15 -0500	[thread overview]
Message-ID: <E1H31iF-0000Oo-IH@fencepost.gnu.org> (raw)
In-Reply-To: <BDEIJAFNGDOAGCJIPKPBEEMCCBAA.drew.adams@oracle.com>

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.

  parent reply	other threads:[~2007-01-06  2:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05 15:51 pp-eval-expression broken Drew Adams
2007-01-05 17:52 ` Drew Adams
2007-01-05 18:58   ` Randal L. Schwartz
2007-01-05 19:14     ` Drew Adams
2007-01-06  2:55 ` Richard Stallman [this message]
2007-01-06  3:24   ` Drew Adams
2007-01-06  6:28     ` Drew Adams
2007-01-07  3:46     ` Richard Stallman
2007-01-09 22:56       ` Drew Adams
2007-01-13 22:27         ` Drew Adams
2007-01-14 14:45           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1H31iF-0000Oo-IH@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).