aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help.el24
1 files changed, 11 insertions, 13 deletions
diff --git a/lisp/help.el b/lisp/help.el
index c067214f992..d5088d8ec75 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -332,7 +332,8 @@ With numeric argument, display information on correspondingly older changes."
332 332
333To record all your input on a file, use `open-dribble-file'." 333To record all your input on a file, use `open-dribble-file'."
334 (interactive) 334 (interactive)
335 (with-output-to-temp-buffer "*Help*" 335 (help-setup-xref (list #'view-lossage) (interactive-p))
336 (with-output-to-temp-buffer (help-buffer)
336 (princ (mapconcat (function (lambda (key) 337 (princ (mapconcat (function (lambda (key)
337 (if (or (integerp key) 338 (if (or (integerp key)
338 (symbolp key) 339 (symbolp key)
@@ -345,8 +346,7 @@ To record all your input on a file, use `open-dribble-file'."
345 (goto-char (point-min)) 346 (goto-char (point-min))
346 (while (progn (move-to-column 50) (not (eobp))) 347 (while (progn (move-to-column 50) (not (eobp)))
347 (search-forward " " nil t) 348 (search-forward " " nil t)
348 (insert "\n")) 349 (insert "\n")))
349 (help-setup-xref nil t))
350 (print-help-return-message))) 350 (print-help-return-message)))
351 351
352 352
@@ -360,13 +360,11 @@ The optional argument PREFIX, if non-nil, should be a key sequence;
360then we display only bindings that start with that prefix. 360then we display only bindings that start with that prefix.
361The optional argument BUFFER specifies which buffer's bindings 361The optional argument BUFFER specifies which buffer's bindings
362to display (default, the current buffer)." 362to display (default, the current buffer)."
363 (interactive "P") 363 (interactive)
364 (or buffer (setq buffer (current-buffer))) 364 (or buffer (setq buffer (current-buffer)))
365 (help-setup-xref (list #'describe-bindings prefix buffer) (interactive-p))
365 (with-current-buffer buffer 366 (with-current-buffer buffer
366 (describe-bindings-internal nil prefix)) 367 (describe-bindings-internal nil prefix)))
367 (with-current-buffer "*Help*"
368 (help-setup-xref (list #'describe-bindings prefix buffer)
369 (interactive-p))))
370 368
371;; This function used to be in keymap.c. 369;; This function used to be in keymap.c.
372(defun describe-bindings-internal (&optional menus prefix) 370(defun describe-bindings-internal (&optional menus prefix)
@@ -484,18 +482,18 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
484 (let ((defn (or (string-key-binding key) (key-binding key)))) 482 (let ((defn (or (string-key-binding key) (key-binding key))))
485 (if (or (null defn) (integerp defn)) 483 (if (or (null defn) (integerp defn))
486 (message "%s is undefined" (key-description key)) 484 (message "%s is undefined" (key-description key))
487 (with-output-to-temp-buffer "*Help*" 485 (help-setup-xref (list #'describe-function defn) (interactive-p))
486 (with-output-to-temp-buffer (help-buffer)
488 (princ (key-description key)) 487 (princ (key-description key))
489 (if (windowp window) 488 (if (windowp window)
490 (princ " at that spot")) 489 (princ " at that spot"))
491 (princ " runs the command ") 490 (princ " runs the command ")
492 (prin1 defn) 491 (prin1 defn)
493 (princ "\n which is ") 492 (princ "\n which is ")
494 (describe-function-1 defn nil (interactive-p)) 493 (describe-function-1 defn)
495 (print-help-return-message))))))) 494 (print-help-return-message)))))))
496 495
497 496
498;;;###autoload
499(defun describe-mode (&optional buffer) 497(defun describe-mode (&optional buffer)
500 "Display documentation of current major mode and minor modes. 498 "Display documentation of current major mode and minor modes.
501The major mode description comes first, followed by the minor modes, 499The major mode description comes first, followed by the minor modes,
@@ -505,14 +503,14 @@ For this to work correctly for a minor mode, the mode's indicator variable
505describes the minor mode." 503describes the minor mode."
506 (interactive) 504 (interactive)
507 (when buffer (set-buffer buffer)) 505 (when buffer (set-buffer buffer))
508 (with-output-to-temp-buffer "*Help*" 506 (help-setup-xref (list #'describe-mode (current-buffer)) (interactive-p))
507 (with-output-to-temp-buffer (help-buffer)
509 (when minor-mode-alist 508 (when minor-mode-alist
510 (princ "The major mode is described first. 509 (princ "The major mode is described first.
511For minor modes, see following pages.\n\n")) 510For minor modes, see following pages.\n\n"))
512 (princ mode-name) 511 (princ mode-name)
513 (princ " mode:\n") 512 (princ " mode:\n")
514 (princ (documentation major-mode)) 513 (princ (documentation major-mode))
515 (help-setup-xref (list #'describe-mode (current-buffer)) (interactive-p))
516 (let ((minor-modes minor-mode-alist)) 514 (let ((minor-modes minor-mode-alist))
517 (while minor-modes 515 (while minor-modes
518 (let* ((minor-mode (car (car minor-modes))) 516 (let* ((minor-mode (car (car minor-modes)))