changeset 39789:e511f555920c

(view-lossage): Call help-setup-xref correctly and earlier. (describe-bindings): Call help-setup-xref earlier. (describe-key): Call help-setup-xref. Fix call to describe-function-1. (describe-mode): Don't autoload. Call help-setup-xref earlier.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 11 Oct 2001 23:34:17 +0000
parents 67f0a4191315
children 1802ca573682
files lisp/help.el
diffstat 1 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help.el	Thu Oct 11 23:34:07 2001 +0000
+++ b/lisp/help.el	Thu Oct 11 23:34:17 2001 +0000
@@ -332,7 +332,8 @@
 
 To record all your input on a file, use `open-dribble-file'."
   (interactive)
-  (with-output-to-temp-buffer "*Help*"
+  (help-setup-xref (list #'view-lossage) (interactive-p))
+  (with-output-to-temp-buffer (help-buffer)
     (princ (mapconcat (function (lambda (key)
 				  (if (or (integerp key)
 					  (symbolp key)
@@ -345,8 +346,7 @@
       (goto-char (point-min))
       (while (progn (move-to-column 50) (not (eobp)))
 	(search-forward " " nil t)
-	(insert "\n"))
-      (help-setup-xref nil t))
+	(insert "\n")))
     (print-help-return-message)))
 
 
@@ -360,13 +360,11 @@
 then we display only bindings that start with that prefix.
 The optional argument BUFFER specifies which buffer's bindings
 to display (default, the current buffer)."
-  (interactive "P")
+  (interactive)
   (or buffer (setq buffer (current-buffer)))
+  (help-setup-xref (list #'describe-bindings prefix buffer) (interactive-p))
   (with-current-buffer buffer
-    (describe-bindings-internal nil prefix))
-  (with-current-buffer "*Help*"
-    (help-setup-xref (list #'describe-bindings prefix buffer)
-		     (interactive-p))))
+    (describe-bindings-internal nil prefix)))
 
 ;; This function used to be in keymap.c.
 (defun describe-bindings-internal (&optional menus prefix)
@@ -484,18 +482,18 @@
       (let ((defn (or (string-key-binding key) (key-binding key))))
 	(if (or (null defn) (integerp defn))
 	    (message "%s is undefined" (key-description key))
-	  (with-output-to-temp-buffer "*Help*"
+	  (help-setup-xref (list #'describe-function defn) (interactive-p))
+	  (with-output-to-temp-buffer (help-buffer)
 	    (princ (key-description key))
 	    (if (windowp window)
 		(princ " at that spot"))
 	    (princ " runs the command ")
 	    (prin1 defn)
 	    (princ "\n   which is ")
-	    (describe-function-1 defn nil (interactive-p))
+	    (describe-function-1 defn)
 	    (print-help-return-message)))))))
 
 
-;;;###autoload
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.
 The major mode description comes first, followed by the minor modes,
@@ -505,14 +503,14 @@
 describes the minor mode."
   (interactive)
   (when buffer (set-buffer buffer))
-  (with-output-to-temp-buffer "*Help*"
+  (help-setup-xref (list #'describe-mode (current-buffer)) (interactive-p))
+  (with-output-to-temp-buffer (help-buffer)
     (when minor-mode-alist
       (princ "The major mode is described first.
 For minor modes, see following pages.\n\n"))
     (princ mode-name)
     (princ " mode:\n")
     (princ (documentation major-mode))
-    (help-setup-xref (list #'describe-mode (current-buffer)) (interactive-p))
     (let ((minor-modes minor-mode-alist))
       (while minor-modes
 	(let* ((minor-mode (car (car minor-modes)))