diff lisp/help-fns.el @ 91795:bfe257ff864c

2008-02-11 Drew Adams <drew.adams@oracle.com> * help.el (describe-key): Joined some split lines to facilitate filling. * help-fns.el (describe-function-1): Fill text of overlong lines.
author Bastien Guerry <bzg@altern.org>
date Tue, 12 Feb 2008 07:10:49 +0000
parents 107ccd98fa12
children a1afa11e3c51
line wrap: on
line diff
--- a/lisp/help-fns.el	Tue Feb 12 06:25:06 2008 +0000
+++ b/lisp/help-fns.el	Tue Feb 12 07:10:49 2008 +0000
@@ -267,7 +267,8 @@
 		  (symbol-function real-function)
 		function))
 	 file-name string
-	 (beg (if (commandp def) "an interactive " "a ")))
+	 (beg (if (commandp def) "an interactive " "a "))
+         (pt1 (with-current-buffer (help-buffer) (point))))
     (setq string
 	  (cond ((or (stringp def)
 		     (vectorp def))
@@ -348,8 +349,12 @@
 	  (re-search-backward "`\\([^`']+\\)'" nil t)
 	  (help-xref-button 1 'help-function-def real-function file-name))))
     (princ ".")
-    (terpri)
+    (with-current-buffer (help-buffer)
+      (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))
+                                (point)))
+    (terpri)(terpri)
     (when (commandp function)
+      (let ((pt2 (with-current-buffer (help-buffer) (point))))
       (if (and (eq function 'self-insert-command)
 	       (eq (key-binding "a") 'self-insert-command)
 	       (eq (key-binding "b") 'self-insert-command)
@@ -369,7 +374,7 @@
 	    (princ "'"))
 
 	  (when keys
-	    (princ (if remapped " which is bound to " "It is bound to "))
+              (princ (if remapped ", which is 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)
@@ -383,7 +388,9 @@
 		(princ "many ordinary text characters"))))
 	  (when (or remapped keys non-modified-keys)
 	    (princ ".")
-	    (terpri)))))
+              (terpri))))
+        (with-current-buffer (help-buffer) (fill-region-as-paragraph pt2 (point)))
+        (terpri)))
     (let* ((arglist (help-function-arglist def))
 	   (doc (documentation function))
 	   (usage (help-split-fundoc doc function)))