-;; Copyright (C) 1989, 1994-1995, 2001-2013 Free Software Foundation,
+;; Copyright (C) 1989, 1994-1995, 2001-2014 Free Software Foundation,
"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."
"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."
(defvar apropos-files-scanned ()
"List of elc files already scanned in current run of `apropos-documentation'.")
(defvar apropos-files-scanned ()
"List of elc files already scanned in current run of `apropos-documentation'.")
(read-string (concat "Search for " subject " (word list or regexp): "))))
(if (string-equal (regexp-quote pattern) pattern)
;; Split into words
(read-string (concat "Search for " subject " (word list or regexp): "))))
(if (string-equal (regexp-quote pattern) pattern)
;; Split into words
(defun apropos-calc-scores (str words)
"Return apropos scores for string STR matching WORDS.
Value is a list of offsets of the words into the string."
(defun apropos-calc-scores (str words)
"Return apropos scores for string STR matching WORDS.
Value is a list of offsets of the words into the string."
(defun apropos-true-hit (str words)
"Return t if STR is a genuine hit.
This may fail if only one of the keywords is matched more than once.
(defun apropos-true-hit (str words)
"Return t if STR is a genuine hit.
This may fail if only one of the keywords is matched more than once.
like `apropos-user-option'."
(interactive (list (apropos-read-pattern
(if current-prefix-arg "user option" "variable"))
like `apropos-user-option'."
(interactive (list (apropos-read-pattern
(if current-prefix-arg "user option" "variable"))
"Like `documentation', except it avoids calling `get_doc_string'.
Will return nil instead."
(while (and function (symbolp function))
"Like `documentation', except it avoids calling `get_doc_string'.
Will return nil instead."
(while (and function (symbolp function))
(if (eq (car-safe function) 'macro)
(setq function (cdr function)))
(setq function (if (byte-code-function-p function)
(if (eq (car-safe function) 'macro)
(setq function (cdr function)))
(setq function (if (byte-code-function-p function)
`apropos-accumulator' to nil before returning.
If SPACING is non-nil, it should be a string; separate items with that string.
`apropos-accumulator' to nil before returning.
If SPACING is non-nil, it should be a string; separate items with that string.
(if (null apropos-accumulator)
(message "No apropos matches for `%s'" apropos-pattern)
(setq apropos-accumulator
(sort apropos-accumulator
(lambda (a b)
(if (null apropos-accumulator)
(message "No apropos matches for `%s'" apropos-pattern)
(setq apropos-accumulator
(sort apropos-accumulator
(lambda (a b)
(if apropos-sort-by-scores
(or (> (cadr a) (cadr b))
(and (= (cadr a) (cadr b))
(if apropos-sort-by-scores
(or (> (cadr a) (cadr b))
(and (= (cadr a) (cadr b))
(if (and (eq apropos-sort-by-scores 'verbose)
(cadr apropos-item))
(insert " (" (number-to-string (cadr apropos-item)) ") "))
(if (and (eq apropos-sort-by-scores 'verbose)
(cadr apropos-item))
(insert " (" (number-to-string (cadr apropos-item)) ") "))