]> code.delx.au - gnu-emacs/blobdiff - lisp/apropos.el
* imenu.el (imenu-default-create-index-function): Remove useless
[gnu-emacs] / lisp / apropos.el
index f5373b38682a6a71a37d0a90b2eaa5bd3d21a860..5f481f54e57e68a58932cccbd3859e5d2dc6d546 100644 (file)
@@ -1,6 +1,7 @@
 ;;; apropos.el --- apropos commands for users and programmers
 
-;; Copyright (C) 1989, 1994-1995, 2001-2012  Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1994-1995, 2001-2013 Free Software Foundation,
+;; Inc.
 
 ;; Author: Joe Wells <jbw@bigbird.bu.edu>
 ;;     Daniel Pfeiffer <occitan@esperanto.org> (rewrite)
 ;; Fixed bug, current-local-map can return nil.
 ;; Change, doesn't calculate key-bindings unless needed.
 ;; Added super-apropos capability, changed print functions.
-;;; Made fast-apropos and super-apropos share code.
-;;; Sped up fast-apropos again.
+;; Made fast-apropos and super-apropos share code.
+;; Sped up fast-apropos again.
 ;; Added apropos-do-all option.
-;;; Added fast-command-apropos.
+;; Added fast-command-apropos.
 ;; Changed doc strings to comments for helping functions.
-;;; Made doc file buffer read-only, buried it.
+;; Made doc file buffer read-only, buried it.
 ;; Only call substitute-command-keys if do-all set.
 
 ;; Optionally use configurable faces to make the output more legible.
@@ -57,7 +58,6 @@
 ;;; Code:
 
 (require 'button)
-(eval-when-compile (require 'cl))
 
 (defgroup apropos nil
   "Apropos commands for users and programmers."
@@ -89,44 +89,44 @@ include key-binding information in its output."
   '((t (:inherit bold)))
   "Face for the symbol name in Apropos output."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defface apropos-keybinding
   '((t (:inherit underline)))
   "Face for lists of keybinding in Apropos output."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defface apropos-property
   '((t (:inherit font-lock-builtin-face)))
   "Face for property name in apropos output, or nil for none."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defface apropos-function-button
   '((t (:inherit (font-lock-function-name-face button))))
   "Button face indicating a function, macro, or command in Apropos."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defface apropos-variable-button
   '((t (:inherit (font-lock-variable-name-face button))))
   "Button face indicating a variable in Apropos."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defface apropos-misc-button
   '((t (:inherit (font-lock-constant-face button))))
   "Button face indicating a miscellaneous object type in Apropos."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defcustom apropos-match-face 'match
   "Face for matching text in Apropos documentation/value, or nil for none.
 This applies when you look for matches in the documentation or variable value
 for the pattern; the part that matches gets displayed in this font."
   :group 'apropos
-  :version "24.2")
+  :version "24.3")
 
 (defcustom apropos-sort-by-scores nil
   "Non-nil means sort matches by scores; best match is shown first.
@@ -640,11 +640,11 @@ the output includes key-bindings of commands."
             (setq lh (cdr lh)))))
       (unless lh-entry (error "Unknown library `%s'" file)))
     (dolist (x (cdr lh-entry))
-      (case (car-safe x)
+      (pcase (car-safe x)
        ;; (autoload (push (cdr x) autoloads))
-       (require (push (cdr x) requires))
-       (provide (push (cdr x) provides))
-       (t (push (or (cdr-safe x) x) symbols))))
+       (`require (push (cdr x) requires))
+       (`provide (push (cdr x) provides))
+       (_ (push (or (cdr-safe x) x) symbols))))
     (let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal.
       (apropos-symbols-internal
        symbols apropos-do-all
@@ -981,7 +981,7 @@ Will return nil instead."
   (setq function (if (byte-code-function-p function)
                     (if (> (length function) 4)
                         (aref function 4))
-                  (if (eq (car-safe function) 'autoload)
+                  (if (autoloadp function)
                       (nth 2 function)
                     (if (eq (car-safe function) 'lambda)
                         (if (stringp (nth 2 function))
@@ -1115,7 +1115,7 @@ If non-nil TEXT is a string that will be printed as a heading."
        (consp (setq symbol
                    (symbol-function symbol)))
        (or (eq (car symbol) 'macro)
-          (if (eq (car symbol) 'autoload)
+          (if (autoloadp symbol)
               (memq (nth 4 symbol)
                     '(macro t))))))