;;; apropos.el --- apropos commands for users and programmers
;; Copyright (C) 1989, 1994, 1995, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Joe Wells <jbw@bigbird.bu.edu>
;; Rewritten: Daniel Pfeiffer <occitan@esperanto.org>
(const :tag "show scores" verbose)))
(defcustom apropos-documentation-sort-by-scores t
- "*Non-nil means sort matches by scores; best match is shown first.
+ "Non-nil means sort matches by scores; best match is shown first.
This applies to `apropos-documentation' only.
If value is `verbose', the computed score is shown for each match."
:group 'apropos
(setq score (apropos-score-symbol symbol))
(unless var-predicate
(if (fboundp symbol)
- (if (setq doc (ignore-errors (documentation symbol t)))
- (progn
+ (if (setq doc (condition-case nil
+ (documentation symbol t)
+ (error 'error)))
+ ;; Eg alias to undefined function.
+ (if (eq doc 'error)
+ "(documentation error)"
(setq score (+ score (apropos-score-doc doc)))
(substring doc 0 (string-match "\n" doc)))
"(not documented)")))
'face 'default 'apropos-symbol (car apropos-item))
(insert-text-button
(if apropos-compact-layout
- (button-type-get type 'apropos-label)
- (format "<%s>" (button-type-get type 'apropos-short-label)))
+ (format "<%s>" (button-type-get type 'apropos-short-label))
+ (button-type-get type 'apropos-label))
'type type
;; Can't use the default button face, since user may have changed the
;; variable! Just say `no' to variables containing faces!