Merge from gnus--devo--0
[bpt/emacs.git] / lisp / descr-text.el
index 7b7a209..9c1d253 100644 (file)
@@ -9,10 +9,10 @@
 
 ;; 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
@@ -20,9 +20,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:
 
   (let ((pp (condition-case signal
                (pp-to-string sexp)
              (error (prin1-to-string signal)))))
-    (when (string-match "\n\\'" pp)
+    (when (string-match-p "\n\\'" pp)
       (setq pp (substring pp 0 (1- (length pp)))))
-    (if (cond ((string-match "\n" pp)
-              nil)
-             ((> (length pp) (- (window-width) (current-column)))
-              nil)
-             (t t))
+
+    (if (and (not (string-match-p "\n" pp))
+            (<= (length pp) (- (window-width) (current-column))))
        (insert pp)
       (insert-text-button
        "[Show]" 'action `(lambda (&rest ignore)
-                       (with-output-to-temp-buffer
-                           "*Pp Eval Output*"
-                         (princ ',pp)))
+                          (with-output-to-temp-buffer
+                              "*Pp Eval Output*"
+                            (princ ',pp)))
        'help-echo "mouse-2, RET: pretty print value in another buffer"))))
 
 (defun describe-property-list (properties)
@@ -495,7 +491,7 @@ as well as widgets, buttons, overlays, and text properties."
                         (cond
                          ((and show-trailing-whitespace
                                (save-excursion (goto-char pos)
-                                               (looking-at "[ \t]+$")))
+                                               (looking-at-p "[ \t]+$")))
                           'trailing-whitespace)
                          ((and nobreak-char-display char (eq char '#xa0))
                           'nobreak-space)
@@ -525,7 +521,7 @@ as well as widgets, buttons, overlays, and text properties."
                (if (eq (car-safe clm) 'insert-text-button)
                    (progn (insert " ") (eval clm))
                  (when (>= (+ (current-column)
-                              (or (string-match "\n" clm)
+                              (or (string-match-p "\n" clm)
                                   (string-width clm))
                               1)
                            (window-width))