aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/help.el23
1 files changed, 18 insertions, 5 deletions
diff --git a/lisp/help.el b/lisp/help.el
index c11e2cb91bc..0bb57ab61d3 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -211,6 +211,9 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
211 (if (documentation defn) 211 (if (documentation defn)
212 (princ (documentation defn)) 212 (princ (documentation defn))
213 (princ "not documented")) 213 (princ "not documented"))
214 (save-excursion
215 (set-buffer standard-output)
216 (help-mode))
214 (print-help-return-message))))) 217 (print-help-return-message)))))
215 218
216(defun describe-mode () 219(defun describe-mode ()
@@ -248,6 +251,9 @@ describes the minor mode."
248 (princ mode-name) 251 (princ mode-name)
249 (princ " mode:\n") 252 (princ " mode:\n")
250 (princ (documentation major-mode)) 253 (princ (documentation major-mode))
254 (save-excursion
255 (set-buffer standard-output)
256 (help-mode))
251 (print-help-return-message))) 257 (print-help-return-message)))
252 258
253;; So keyboard macro definitions are documented correctly 259;; So keyboard macro definitions are documented correctly
@@ -320,7 +326,8 @@ of the key sequence that ran this command."
320 (goto-char (point-min)) 326 (goto-char (point-min))
321 (while (progn (move-to-column 50) (not (eobp))) 327 (while (progn (move-to-column 50) (not (eobp)))
322 (search-forward " " nil t) 328 (search-forward " " nil t)
323 (insert "\n"))) 329 (insert "\n"))
330 (help-mode))
324 (print-help-return-message))) 331 (print-help-return-message)))
325 332
326(defalias 'help 'help-for-help) 333(defalias 'help 'help-for-help)
@@ -461,8 +468,11 @@ C-w print information on absence of warranty for GNU Emacs."
461 (princ "not documented")) 468 (princ "not documented"))
462 ) 469 )
463 (print-help-return-message) 470 (print-help-return-message)
464 ;; Return the text we displayed. 471 (save-excursion
465 (save-excursion (set-buffer standard-output) (buffer-string)))) 472 (set-buffer standard-output)
473 (help-mode)
474 ;; Return the text we displayed.
475 (buffer-string))))
466 476
467(defun variable-at-point () 477(defun variable-at-point ()
468 (condition-case () 478 (condition-case ()
@@ -510,8 +520,11 @@ Returns the documentation as a string, also."
510 (princ (substitute-command-keys doc)) 520 (princ (substitute-command-keys doc))
511 (princ "not documented as a variable."))) 521 (princ "not documented as a variable.")))
512 (print-help-return-message) 522 (print-help-return-message)
513 ;; Return the text we displayed. 523 (save-excursion
514 (save-excursion (set-buffer standard-output) (buffer-string)))) 524 (set-buffer standard-output)
525 (help-mode)
526 ;; Return the text we displayed.
527 (buffer-string))))
515 528
516(defun where-is (definition) 529(defun where-is (definition)
517 "Print message listing key sequences that invoke specified command. 530 "Print message listing key sequences that invoke specified command.