]> code.delx.au - gnu-emacs/blobdiff - lisp/help-fns.el
Fix changes in 2012-04-09T18:12:40Z!schwab@linux-m68k.org.
[gnu-emacs] / lisp / help-fns.el
index 5e034b14fdee992c0e4ec2529b8522d7b69bd0e9..ed52be6cc1e5264129be11b645774be99e81c532 100644 (file)
@@ -1,6 +1,6 @@
 ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2011
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2012
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -256,7 +256,7 @@ if the variable `help-downcase-arguments' is non-nil."
               ;; so let's skip over it
               (search-backward "(")
               (goto-char (scan-sexps (point) 1)))))
-        ;; Highlight aguments in the USAGE string
+        ;; Highlight arguments in the USAGE string
         (setq usage (help-do-arg-highlight (buffer-string) args))
         ;; Highlight arguments in the DOC string
         (setq doc (and doc (help-do-arg-highlight doc args))))))
@@ -482,12 +482,14 @@ suitable file is found, return nil."
                  (if (member (event-modifiers (aref key 0)) '(nil (shift)))
                      (push key non-modified-keys)))
                (when remapped
-                 (princ "It is remapped to `")
+                 (princ "Its keys are remapped to `")
                  (princ (symbol-name remapped))
-                 (princ "'"))
+                 (princ "'.\n"))
 
                (when keys
-                 (princ (if remapped ", which is bound to " "It is bound to "))
+                 (princ (if remapped
+                            "Without this remapping, it would be bound to "
+                          "It is bound to "))
                  ;; If lots of ordinary text characters run this command,
                  ;; don't mention them one by one.
                  (if (< (length non-modified-keys) 10)
@@ -707,12 +709,19 @@ it is displayed along with the global value."
              (with-current-buffer standard-output
                (setq val-start-pos (point))
                (princ "value is ")
-               (let ((from (point)))
-                 (terpri)
-                 (pp val)
-                 (if (< (point) (+ 68 (line-beginning-position 0)))
-                     (delete-region from (1+ from))
-                   (delete-region (1- from) from))
+               (let ((from (point))
+                     (line-beg (line-beginning-position))
+                     ;;
+                     (print-rep
+                      (let ((print-quoted t))
+                        (prin1-to-string val))))
+                 (if (< (+ (length print-rep) (point) (- line-beg)) 68)
+                     (insert print-rep)
+                   (terpri)
+                   (pp val)
+                   (if (< (point) (+ 68 (line-beginning-position 0)))
+                       (delete-region from (1+ from))
+                     (delete-region (1- from) from)))
                  (let* ((sv (get variable 'standard-value))
                         (origval (and (consp sv)
                                       (condition-case nil