(defvar help-map (make-sparse-keymap) "\ Keymap for characters following the Help key.") (define-key global-map "" (quote help-command)) (fset (quote help-command) help-map) (define-key help-map "" (quote help-for-help)) (define-key help-map "?" (quote help-for-help)) (define-key help-map "" (quote describe-copying)) (define-key help-map "" (quote describe-distribution)) (define-key help-map "" (quote describe-no-warranty)) (define-key help-map "a" (quote command-apropos)) (define-key help-map "b" (quote describe-bindings)) (define-key help-map "c" (quote describe-key-briefly)) (define-key help-map "k" (quote describe-key)) (define-key help-map "d" (quote describe-function)) (define-key help-map "f" (quote describe-function)) (define-key help-map "i" (quote info)) (define-key help-map "l" (quote view-lossage)) (define-key help-map "m" (quote describe-mode)) (define-key help-map "" (quote view-emacs-news)) (define-key help-map "n" (quote view-emacs-news)) (define-key help-map "s" (quote describe-syntax)) (define-key help-map "t" (quote help-with-tutorial)) (define-key help-map "w" (quote where-is)) (define-key help-map "v" (quote describe-variable)) (defun help-with-tutorial nil "\ Select the Emacs learn-by-doing tutorial." (interactive) (byte-code "Ĉ! !!!X!!!ĉ \"!eb! ` `\" !e`\"#!eb!)" [file buffer-file-name default-directory auto-save-file-name nil exec-directory expand-file-name "~/TUTORIAL" delete-other-windows get-file-buffer switch-to-buffer create-file-buffer "~/" insert-file-contents "TUTORIAL" search-forward " <<" beginning-of-line delete-region end-of-line newline - window-height selected-window count-lines 6 set-buffer-modified-p] 22)) (defun describe-key-briefly (key) "\ Print the name of the function KEY invokes. KEY is a string." (interactive "kDescribe key briefly: ") (byte-code "ˆ !?! !\", !9(+!#)" [defn key nil key-binding integerp message "%s is undefined" key-description "%s runs the command %s" prin1-to-string] 10)) (defun print-help-return-message (&optional function) "\ Display or return message saying how to restore windows after help command. Computes a message and applies the argument FUNCTION to it. If FUNCTION is nil, applies `message' to it, thus printing it." (byte-code "!?# ! ɂʂ!!\"" [standard-output function t pop-up-windows get-buffer-window funcall message substitute-command-keys one-window-p "Type \\[delete-other-windows] to remove help window." "Type \\[switch-to-buffer] RET to remove help window." "Type \\[switch-to-buffer-other-window] RET to restore old contents of help window."] 6)) (defun describe-key (key) "\ Display documentation of the function KEY invokes. KEY is a string." (interactive "kDescribe key: ") (byte-code "ˆ !?! !\"9Ȑ!!!2!!5! )" [defn key nil key-binding integerp message "%s is undefined" key-description "*Help*" prin1 princ ": " documentation "not documented" print-help-return-message] 13)) (defun describe-mode nil "\ Display documentation of current major mode." (interactive) (byte-code "ˆÐ!! !! " [mode-name major-mode nil "*Help*" princ " Mode: " documentation print-help-return-message] 7)) (defun describe-distribution nil "\ Display info on how to obtain the latest version of GNU Emacs." (interactive) (byte-code "\"!" [exec-directory nil find-file-read-only expand-file-name "DISTRIB"] 4)) (defun describe-copying nil "\ Display info on how you may redistribute copies of GNU Emacs." (interactive) (byte-code "\"!eb" [exec-directory nil find-file-read-only expand-file-name "COPYING"] 4)) (defun describe-no-warranty nil "\ Display info on all the kinds of warranty Emacs does NOT have." (interactive) (byte-code " !!)" [case-fold-search nil describe-copying search-forward "NO WARRANTY" recenter 0] 4)) (defun view-emacs-news nil "\ Display info on recent changes to Emacs." (interactive) (byte-code "\"!" [exec-directory nil find-file-read-only expand-file-name "NEWS"] 4)) (defun view-lossage nil "\ Display last 100 input keystrokes." (interactive) (byte-code "Ð !!qeb!m?'#c) " [standard-output nil t "*Help*" princ key-description recent-keys move-to-column 50 search-forward " " " " print-help-return-message] 10)) (defun help-for-help nil "\ You have typed C-h, the help character. Type a Help option: A command-apropos. Give a substring, and see a list of commands (functions interactively callable) that contain that substring. See also the apropos command. B describe-bindings. Display table of all key bindings. C describe-key-briefly. Type a command key sequence; it prints the function name that sequence runs. F describe-function. Type a function name and get documentation of it. I info. The info documentation reader. K describe-key. Type a command key sequence; it displays the full documentation. L view-lossage. Shows last 100 characters you typed. M describe-mode. Print documentation of current major mode, which describes the commands peculiar to it. N view-emacs-news. Shows emacs news file. S describe-syntax. Display contents of syntax table, plus explanations T help-with-tutorial. Select the Emacs learn-by-doing tutorial. V describe-variable. Type name of a variable; it displays the variable's documentation and value. W where-is. Type command name; it prints which keystrokes invoke that command. C-c print Emacs copying permission (General Public License). C-d print Emacs ordering information. C-n print news of recent Emacs changes. C-w print information on absence of warranty for GNU Emacs." (interactive) (byte-code "ň!rUUʋ! A\"A * !, ))" [char cursor-in-echo-area t defn help-map nil message "A B C F I K L M N S T V W C-c C-d C-n C-w. Type C-h again for more help: " 8 63 ((byte-code "! !ceb>@> >& d!3Ђ4\"r)" [char cursor-in-echo-area t switch-to-buffer "*Help*" erase-buffer documentation help-for-help (8 63 22 32 127 246) (22 32) scroll-up (127 246) scroll-down message "A B C F I K L M N S T V W C-c C-d C-n C-w%s: " pos-visible-in-window-p "" " or Space to scroll"] 10)) assq downcase call-interactively ding] 6)) (defun function-called-at-point nil (byte-code "" [nil (byte-code "e`Z]d\"!!p!9'!')))" [obj narrow-to-region 1000 backward-up-list 1 forward-char nil read fboundp] 6) ((error (byte-code "" [nil] 1)))] 3)) (defun describe-function (function) "\ Display the full documentation of FUNCTION (a symbol)." (interactive (byte-code " \" $ \"&) !C+" [fn enable-recursive-minibuffers t val obarray function-called-at-point nil completing-read format "Describe function (default %s): " "Describe function: " fboundp equal "" intern] 7)) (byte-code "ƈǐ !! ! !!! " [fn enable-recursive-minibuffers t val obarray function nil "*Help*" prin1 princ ": " documentation "not documented" print-help-return-message] 9)) (defun variable-at-point nil (byte-code "" [nil (byte-code "!!p!9!))" [obj forward-sexp -1 skip-chars-forward "'" read boundp] 5) ((error (byte-code "" [nil] 1)))] 3)) (defun describe-variable (variable) "\ Display the full documentation of VARIABLE (a symbol)." (interactive (byte-code " \" $ \"&) !C+" [v enable-recursive-minibuffers t val obarray variable-at-point nil completing-read format "Describe variable (default %s): " "Describe variable: " boundp equal "" intern] 7)) (byte-code "LjȐ !! !?! J! ! \"?!!B!) " [v enable-recursive-minibuffers t val obarray variable doc nil "*Help*" prin1 princ "'s value is " boundp "void." terpri "Documentation:" documentation-property variable-documentation substitute-command-keys "not documented as a variable." print-help-return-message] 16)) (defun command-apropos (string) "\ Like apropos but lists only symbols that are names of commands (interactively callable functions)." (interactive "sCommand apropos (regexp): ") (byte-code "È!!) \"!)" [message standard-output string nil get-buffer-create "*Help*" print-help-return-message identity apropos commandp] 5))