]> code.delx.au - gnu-emacs/blobdiff - lisp/apropos.el
(ispell): New function, replacing an alias.
[gnu-emacs] / lisp / apropos.el
index 61cc0fda3f0696aca7ad8bb2850b5aa673098dd8..c184a689bf644e99711226f097917f637a33491b 100644 (file)
@@ -112,6 +112,8 @@ for the regexp; the part that matches gets displayed in this font."
     map)
   "Keymap used in Apropos mode.")
 
+(defvar apropos-mode-hook nil
+  "*Hook run when mode is turned on.")
 
 (defvar apropos-regexp nil
   "Regexp used in current apropos run.")
@@ -123,7 +125,7 @@ for the regexp; the part that matches gets displayed in this font."
   "Alist of symbols already found in current apropos run.")
 
 (defvar apropos-item ()
-  "Current item in or for apropos-accumulator.")
+  "Current item in or for `apropos-accumulator'.")
 \f
 ;;;###autoload
 (defun apropos-mode ()
@@ -134,12 +136,13 @@ for the regexp; the part that matches gets displayed in this font."
   (kill-all-local-variables)
   (use-local-map apropos-mode-map)
   (setq major-mode 'apropos-mode
-       mode-name "Apropos"))
+       mode-name "Apropos")
+  (run-hooks 'apropos-mode-hook))
 
 ;;;###autoload
 (defun apropos-variable (regexp &optional do-all)
   "Show user variables that match REGEXP.
-With optional prefix ARG or if `apropos-do-all' is non-nil, also show
+With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also show
 normal variables."
   (interactive (list (read-string
                       (concat "Apropos "
@@ -160,8 +163,8 @@ normal variables."
 (fset 'command-apropos 'apropos-command)
 ;;;###autoload
 (defun apropos-command (apropos-regexp &optional do-all var-predicate)
-  "Show commands (interactively callable functions) that match REGEXP.
-With optional prefix ARG, or if `apropos-do-all' is non-nil, also show
+  "Show commands (interactively callable functions) that match APROPOS-REGEXP.
+With optional prefix DO-ALL, or if `apropos-do-all' is non-nil, also show
 noninteractive functions.
 
 If VAR-PREDICATE is non-nil, show only variables, and only those that
@@ -210,10 +213,10 @@ satisfy the predicate VAR-PREDICATE."
 
 ;;;###autoload
 (defun apropos (apropos-regexp &optional do-all)
-  "Show all bound symbols whose names match REGEXP.
-With optional prefix ARG or if `apropos-do-all' is non-nil, also show unbound
-symbols and key bindings, which is a little more time-consuming.
-Returns list of symbols and documentation found."
+  "Show all bound symbols whose names match APROPOS-REGEXP.
+With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also
+show unbound symbols and key bindings, which is a little more
+time-consuming.  Returns list of symbols and documentation found."
   (interactive "sApropos symbol (regexp): \nP")
   (setq apropos-accumulator
        (apropos-internal apropos-regexp
@@ -277,8 +280,8 @@ Returns list of symbols and documentation found."
 
 ;;;###autoload
 (defun apropos-value (apropos-regexp &optional do-all)
-  "Show all symbols whose value's printed image matches REGEXP.
-With optional prefix ARG or if `apropos-do-all' is non-nil, also looks
+  "Show all symbols whose value's printed image matches APROPOS-REGEXP.
+With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also looks
 at the function and at the names and values of properties.
 Returns list of symbols and values found."
   (interactive "sApropos value (regexp): \nP")
@@ -302,8 +305,8 @@ Returns list of symbols and values found."
 
 ;;;###autoload
 (defun apropos-documentation (apropos-regexp &optional do-all)
-  "Show symbols whose documentation contain matches for REGEXP.
-With optional prefix ARG or if `apropos-do-all' is non-nil, also use
+  "Show symbols whose documentation contain matches for APROPOS-REGEXP.
+With optional prefix DO-ALL or if `apropos-do-all' is non-nil, also use
 documentation that is not stored in the documentation file and show key
 bindings.
 Returns list of symbols and documentation found."
@@ -468,7 +471,7 @@ Returns list of symbols and documentation found."
 
 
 (defun apropos-safe-documentation (function)
-  "Like documentation, except it avoids calling `get_doc_string'.
+  "Like `documentation', except it avoids calling `get_doc_string'.
 Will return nil instead."
   (while (and function (symbolp function))
     (setq function (if (fboundp function)
@@ -518,7 +521,7 @@ alphabetically by symbol name; but this function also sets
            symbol item point1 point2)
        (set-buffer standard-output)
        (apropos-mode)
-       (if window-system
+       (if (display-mouse-p)
            (insert "If you move the mouse over text that changes color,\n"
                    (substitute-command-keys
                     "you can click \\[apropos-mouse-follow] to get more information.\n")))
@@ -560,7 +563,7 @@ alphabetically by symbol name; but this function also sets
                   (insert
                    (mapconcat
                     (lambda (key)
-                      (setq key (condition-case () 
+                      (setq key (condition-case ()
                                     (key-description key)
                                   (error)))
                       (if apropos-keybinding-face
@@ -591,14 +594,15 @@ alphabetically by symbol name; but this function also sets
                                   "Macro"
                                 "Function"))
                             t)
-         ;; We used to use customize-variable-other-window instead
+         ;; We used to use `customize-variable-other-window' instead
          ;; for a customizable variable, but that is slow.
          ;; It is better to show an ordinary help buffer
          ;; and let the user click on the customization button
          ;; in that buffer, if he wants to.
+         ;; Likewise for `customize-face-other-window'.
          (apropos-print-doc 'describe-variable 2 "Variable" t)
          (apropos-print-doc 'customize-group-other-window 6 "Group" t)
-         (apropos-print-doc 'customize-face-other-window 5 "Face" t)
+         (apropos-print-doc 'describe-face 5 "Face" t)
          (apropos-print-doc 'widget-browse-other-window 4 "Widget" t)
          (apropos-print-doc 'apropos-describe-plist 3
                             "Plist" nil))