X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/cdd672cc5a5a902592922f6eb735b0b378d0d9d6..3d24868836b773b9a698eb1f34e3903462f14843:/lisp/help.el diff --git a/lisp/help.el b/lisp/help.el index a067e23e0f..b832ffb6c7 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1,6 +1,6 @@ ;;; help.el --- help commands for Emacs -;; Copyright (C) 1985, 1986 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help, internal @@ -30,7 +30,7 @@ ;; Get the macro make-help-screen when this is compiled, ;; or run interpreted, but not when the compiled code is loaded. -(eval-when-compile (require 'help-screen)) +(eval-when-compile (require 'help-macro)) (defvar help-map (make-sparse-keymap) "Keymap for characters following the Help key.") @@ -212,29 +212,29 @@ describes the minor mode." (print-help-return-message))) (make-help-screen help-for-help - "A B C F I K L M N P S T V W C-c C-d C-n C-w. Type \\[help-for-help] again for more help: " + "a b c f i k l m n p s t v w C-c C-d C-n C-w. Type \\[help-for-help] again for more help: " "You have typed \\[help-for-help], the help character. Type a Help option: -A command-apropos. Give a substring, and see a list of commands +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; +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; +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, +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. -P finder-by-keyword. Find packages matching a given topic keyword. -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; +n view-emacs-news. Shows emacs news file. +p finder-by-keyword. Find packages matching a given topic keyword. +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 +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. @@ -281,7 +281,9 @@ C-w print information on absence of warranty for GNU Emacs." (princ ": ") (let* ((def (symbol-function function)) (beg (if (commandp def) "an interactive " "a "))) - (princ (cond ((stringp def) "a keyboard macro.") + (princ (cond ((or (stringp def) + (vectorp def)) + "a keyboard macro.") ((subrp def) (concat beg "built-in function.")) ((byte-code-function-p def) @@ -303,24 +305,25 @@ C-w print information on absence of warranty for GNU Emacs." )) (t ""))) (terpri) + (let ((arglist (cond ((byte-code-function-p def) + (car (append def nil))) + ((eq (car-safe def) 'lambda) + (nth 1 def)) + (t t)))) + (if (listp arglist) + (progn + (princ (cons function + (mapcar (lambda (arg) + (if (memq arg '(&optional &rest)) + arg + (intern (upcase (symbol-name arg))))) + arglist))) + (terpri)))) (if (documentation function) (progn (terpri) (princ (documentation function))) (princ "not documented")) - (cond ((byte-code-function-p def) - (save-excursion - (set-buffer standard-output) - (or (eq (char-after (1- (point-max))) ?\n) - (terpri))) - (terpri) - (princ (car (append def nil)))) - ((eq (car-safe def) 'lambda) - (save-excursion - (set-buffer standard-output) - (or (eq (char-after (1- (point-max))) ?\n) - (terpri))) - (terpri) - (princ (nth 1 def))))) + ) (print-help-return-message) ;; Return the text we displayed. (save-excursion (set-buffer standard-output) (buffer-string))))