comparison lisp/prim/help.el @ 120:cca96a509cfe r20-1b12

Import from CVS: tag r20-1b12
author cvs
date Mon, 13 Aug 2007 09:25:29 +0200
parents 7d55a9ba150c
children 25f70ba0133c
comparison
equal deleted inserted replaced
119:d101af7320b8 120:cca96a509cfe
32 32
33 ;#### FSFmacs 33 ;#### FSFmacs
34 ;; Get the macro make-help-screen when this is compiled, 34 ;; Get the macro make-help-screen when this is compiled,
35 ;; or run interpreted, but not when the compiled code is loaded. 35 ;; or run interpreted, but not when the compiled code is loaded.
36 ;(eval-when-compile (require 'help-macro)) 36 ;(eval-when-compile (require 'help-macro))
37
38 (defgroup help-appearance nil
39 "Appearance of help buffers"
40 :group 'help)
37 41
38 (defvar help-map (let ((map (make-sparse-keymap))) 42 (defvar help-map (let ((map (make-sparse-keymap)))
39 (set-keymap-name map 'help-map) 43 (set-keymap-name map 'help-map)
40 (set-keymap-prompt 44 (set-keymap-prompt
41 map (purecopy (gettext "(Type ? for further options)"))) 45 map (purecopy (gettext "(Type ? for further options)")))
337 (gettext "Type \\[switch-to-buffer] RET to remove help window.")) 341 (gettext "Type \\[switch-to-buffer] RET to remove help window."))
338 (gettext "Type \\[switch-to-buffer-other-window] RET to restore the other window."))) 342 (gettext "Type \\[switch-to-buffer-other-window] RET to restore the other window.")))
339 (substitute-command-keys 343 (substitute-command-keys
340 (gettext " \\[scroll-other-window] to scroll the help.")))))) 344 (gettext " \\[scroll-other-window] to scroll the help."))))))
341 345
342 (defvar help-selects-help-window t 346 (defcustom help-selects-help-window t
343 "*If nil, use the \"old Emacs\" behavior for Help buffers. 347 "*If nil, use the \"old Emacs\" behavior for Help buffers.
344 This just displays the buffer in another window, rather than selecting 348 This just displays the buffer in another window, rather than selecting
345 the window.") 349 the window."
350 :type 'boolean
351 :group 'help-appearance)
346 352
347 ;; Use this function for displaying help when C-h something is pressed 353 ;; Use this function for displaying help when C-h something is pressed
348 ;; or in similar situations. Do *not* use it when you are displaying 354 ;; or in similar situations. Do *not* use it when you are displaying
349 ;; a help message and then prompting for input in the minibuffer -- 355 ;; a help message and then prompting for input in the minibuffer --
350 ;; this macro usually selects the help buffer, which is not what you 356 ;; this macro usually selects the help buffer, which is not what you
743 (let ((obj (read (current-buffer)))) 749 (let ((obj (read (current-buffer))))
744 (and (symbolp obj) (fboundp obj) obj))) 750 (and (symbolp obj) (fboundp obj) obj)))
745 (set-syntax-table stab))) 751 (set-syntax-table stab)))
746 (error nil)))) 752 (error nil))))
747 753
748 (defvar describe-function-show-arglist t ; default to nil for the non-hackers? 754 ;; default to nil for the non-hackers?
749 "*If true, then describe-function will show its arglist if the function is 755 (defcustom describe-function-show-arglist t
750 not an autoload.") 756 "*If non-nil, describe-function will show its arglist,
757 unless the function is autoloaded."
758 :type 'boolean
759 :group 'help-appearance)
751 760
752 (defun describe-function-find-file (function) 761 (defun describe-function-find-file (function)
753 (and (boundp 'load-history) ; not standardly bound in XEmacs 762 (and (boundp 'load-history) ; not standardly bound in XEmacs
754 (let ((files load-history) 763 (let ((files load-history)
755 file) 764 file)
1105 (progn 1114 (progn
1106 (princ compatible) 1115 (princ compatible)
1107 (terpri) 1116 (terpri)
1108 (terpri))) 1117 (terpri)))
1109 ;; don't bother to print anything if variable is obsolete and aliased. 1118 ;; don't bother to print anything if variable is obsolete and aliased.
1110 (if (or (not obsolete) (not aliases)) 1119 (when (or (not obsolete) (not aliases))
1111 (if doc 1120 (if doc
1112 ;; note: documentation-property calls substitute-command-keys. 1121 ;; note: documentation-property calls substitute-command-keys.
1113 (princ doc) 1122 (princ doc)
1114 (princ "not documented as a variable.")))) 1123 (princ "not documented as a variable."))
1124 (terpri)))
1115 (save-excursion 1125 (save-excursion
1116 (set-buffer standard-output) 1126 (set-buffer standard-output)
1117 ;; Return the text we displayed. 1127 ;; Return the text we displayed.
1118 (buffer-string)))))) 1128 (buffer-string))))))
1119 1129