Fix up comment convention on the arch-tag lines.
[bpt/emacs.git] / lisp / emacs-lisp / pp.el
index 542948c..9ce852f 100644 (file)
@@ -1,7 +1,7 @@
 ;;; pp.el --- pretty printer for Emacs Lisp
 
 ;; Copyright (C) 1989, 1993, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Randal Schwartz <merlyn@stonehenge.com>
 ;; Keywords: lisp
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -27,6 +27,8 @@
 
 ;;; Code:
 
+(defvar font-lock-verbose)
+
 (defgroup pp nil
   "Pretty printer for Emacs Lisp."
   :prefix "pp-"
@@ -96,11 +98,12 @@ Output stream is STREAM, or value of `standard-output' (which see)."
 
 ;;;###autoload
 (defun pp-eval-expression (expression)
-  "Evaluate EXPRESSION and pretty-print value into a new display buffer.
-If the pretty-printed value fits on one line, the message line is used
-instead.  The value is also consed onto the front of the list
-in the variable `values'."
-  (interactive "xPp-eval: ")
+  "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)))
+  (message "Evaluating...")
   (setq values (cons (eval expression) values))
   (let* ((old-show-function temp-buffer-show-function)
         ;; Use this function to display the buffer.
@@ -124,13 +127,16 @@ in the variable `values'."
                         (progn
                           (select-window window)
                           (run-hooks 'temp-buffer-show-hook))
-                      (select-window old-selected)))
+                      (select-window old-selected)
+                      (message "Evaluating...done.  \
+See buffer *Pp Eval Output*.")))
                 (message "%s" (buffer-substring (point-min) (point)))
                 ))))))
     (with-output-to-temp-buffer "*Pp Eval Output*"
       (pp (car values))
       (with-current-buffer standard-output
        (emacs-lisp-mode)
+       (setq buffer-read-only nil)
        (set (make-local-variable 'font-lock-verbose) nil)))))
 
 ;;;###autoload
@@ -173,5 +179,5 @@ Ignores leading comment characters."
 
 (provide 'pp)                          ; so (require 'pp) works
 
-;;; arch-tag: b0f7c65b-02c7-42bb-9ee3-508a59b8fbb9
+;; arch-tag: b0f7c65b-02c7-42bb-9ee3-508a59b8fbb9
 ;;; pp.el ends here