]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/pp.el
ert-x trivia
[gnu-emacs] / lisp / emacs-lisp / pp.el
index 1fbbfe420b70cc443f3892ac0233deb926ceeff8..c795d985b7e01912de71791d69c49b1eb10db1cf 100644 (file)
@@ -1,17 +1,16 @@
 ;;; pp.el --- pretty printer for Emacs Lisp
 
-;; Copyright (C) 1989, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1993, 2001-2012 Free Software Foundation, Inc.
 
 ;; Author: Randal Schwartz <merlyn@stonehenge.com>
 ;; Keywords: lisp
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -35,7 +32,7 @@
   :group 'lisp)
 
 (defcustom pp-escape-newlines t
-  "*Value of `print-escape-newlines' used by pp-* functions."
+  "Value of `print-escape-newlines' used by pp-* functions."
   :type 'boolean
   :group 'pp)
 
@@ -44,8 +41,7 @@
   "Return a string containing the pretty-printed representation of OBJECT.
 OBJECT can be any Lisp object.  Quoting characters are used as needed
 to make output that `read' can handle, whenever this is possible."
-  (save-excursion
-    (set-buffer (generate-new-buffer " pp-to-string"))
+  (with-current-buffer (generate-new-buffer " pp-to-string")
     (unwind-protect
        (progn
          (lisp-mode-variables nil)
@@ -107,8 +103,7 @@ after OUT-BUFFER-NAME."
         (temp-buffer-show-function
          (function
           (lambda (buf)
-            (save-excursion
-              (set-buffer buf)
+            (with-current-buffer buf
               (goto-char (point-min))
               (end-of-line 1)
               (if (or (< (1+ (point)) (point-max))
@@ -206,5 +201,4 @@ Ignores leading comment characters."
 
 (provide 'pp)                          ; so (require 'pp) works
 
-;; arch-tag: b0f7c65b-02c7-42bb-9ee3-508a59b8fbb9
 ;;; pp.el ends here