(vc-register): Allow registering a file passed as a
[bpt/emacs.git] / lisp / apropos.el
index 4e5109c..9fddf01 100644 (file)
@@ -1,7 +1,7 @@
 ;;; apropos.el --- apropos commands for users and programmers
 
 ;; Copyright (C) 1989, 1994, 1995, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
 ;; Rewritten: Daniel Pfeiffer <occitan@esperanto.org>
@@ -11,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -142,7 +142,7 @@ If value is `verbose', the computed score is shown for each match."
   "Apropos pattern as entered by user.")
 
 (defvar apropos-pattern-quoted nil
-  "Apropos pattern passed through `regexp-quoute'.")
+  "Apropos pattern passed through `regexp-quote'.")
 
 (defvar apropos-words ()
   "Current list of apropos words extracted from `apropos-pattern'.")
@@ -168,9 +168,10 @@ If value is `verbose', the computed score is shown for each match."
 (defvar apropos-synonyms '(
   ("find" "open" "edit")
   ("kill" "cut")
-  ("yank" "paste"))
+  ("yank" "paste")
+  ("region" "selection"))
   "List of synonyms known by apropos.
-Each element is a list of words where the first word is the standard emacs
+Each element is a list of words where the first word is the standard Emacs
 term, and the rest of the words are alternative terms.")
 
 \f
@@ -502,27 +503,31 @@ while a list of strings is used as a word list."
 
 ;;;###autoload
 (defun apropos (pattern &optional do-all)
-  "Show all bound symbols whose names match PATTERN.
+  "Show all meaningful Lisp symbols whose names match PATTERN.
+Symbols are shown if they are defined as functions, variables, or
+faces, or if they have nonempty property lists.
+
 PATTERN can be a word, a list of words (separated by spaces),
 or a regexp (using some regexp special characters).  If it is a word,
 search for matches for that word as a substring.  If it is a list of words,
 search for matches for any two (or more) of those words.
 
-With \\[universal-argument] prefix, 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."
+With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil,
+consider all symbols (if they match PATTERN).
+
+Returns list of symbols and documentation found."
   (interactive (list (apropos-read-pattern "symbol")
                     current-prefix-arg))
   (apropos-parse-pattern pattern)
   (apropos-symbols-internal
    (apropos-internal apropos-regexp
-                         (and (not do-all)
-                              (not apropos-do-all)
-                              (lambda (symbol)
-                                (or (fboundp symbol)
-                                    (boundp symbol)
-                                    (facep symbol)
-                                    (symbol-plist symbol)))))
+                    (and (not do-all)
+                         (not apropos-do-all)
+                         (lambda (symbol)
+                           (or (fboundp symbol)
+                               (boundp symbol)
+                               (facep symbol)
+                               (symbol-plist symbol)))))
    (or do-all apropos-do-all)))
 
 (defun apropos-symbols-internal (symbols keys &optional text)
@@ -571,7 +576,7 @@ time-consuming.  Returns list of symbols and documentation found."
 
 ;;;###autoload
 (defun apropos-value (pattern &optional do-all)
-  "Show all symbols whose value's printed image matches PATTERN.
+  "Show all symbols whose value's printed representation matches PATTERN.
 PATTERN can be a word, a list of words (separated by spaces),
 or a regexp (using some regexp special characters).  If it is a word,
 search for matches for that word as a substring.  If it is a list of words,
@@ -616,7 +621,7 @@ Returns list of symbols and values found."
 
 ;;;###autoload
 (defun apropos-documentation (pattern &optional do-all)
-  "Show symbols whose documentation contain matches for PATTERN.
+  "Show symbols whose documentation contains matches for PATTERN.
 PATTERN can be a word, a list of words (separated by spaces),
 or a regexp (using some regexp special characters).  If it is a word,
 search for matches for that word as a substring.  If it is a list of words,
@@ -903,6 +908,7 @@ If non-nil TEXT is a string that will be printed as a heading."
          ;; Calculate key-bindings if we want them.
          (and do-keys
               (commandp symbol)
+              (not (eq symbol 'self-insert-command))
               (indent-to 30 1)
               (if (let ((keys
                          (save-excursion
@@ -999,7 +1005,7 @@ If non-nil TEXT is a string that will be printed as a heading."
 (defun apropos-describe-plist (symbol)
   "Display a pretty listing of SYMBOL's plist."
   (help-setup-xref (list 'apropos-describe-plist symbol) (interactive-p))
-  (with-output-to-temp-buffer (help-buffer)
+  (with-help-window (help-buffer)
     (set-buffer standard-output)
     (princ "Symbol ")
     (prin1 symbol)
@@ -1008,8 +1014,7 @@ If non-nil TEXT is a string that will be printed as a heading."
        (put-text-property (+ (point-min) 7) (- (point) 14)
                           'face apropos-symbol-face))
     (insert (apropos-format-plist symbol "\n  "))
-    (princ ")")
-    (print-help-return-message)))
+    (princ ")")))
 
 
 (provide 'apropos)