Function: apropos-value

apropos-value is an autoloaded, interactive and byte-compiled function defined in apropos.el.gz.

Signature

(apropos-value PATTERN &optional DO-ALL)

Documentation

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, search for matches for any two (or more) of those words.

With C-u (universal-argument) prefix, or if apropos-do-all is non-nil, also looks at function definitions (arguments, documentation and body) and at the names and values of properties.

Returns list of symbols and values found.

View in manual

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/apropos.el.gz
;;;###autoload
(defun apropos-value (pattern &optional do-all)
  "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,
search for matches for any two (or more) of those words.

With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, also looks
at function definitions (arguments, documentation and body) and at the
names and values of properties.

Returns list of symbols and values found."
  (interactive (list (apropos-read-pattern "value")
		     current-prefix-arg))
  (setq apropos--current (list #'apropos-value pattern do-all))
  (apropos-parse-pattern pattern t)
  (or do-all (setq do-all apropos-do-all))
  (setq apropos-accumulator ())
  (let (f v p)
    (mapatoms
     (lambda (symbol)
       (setq f nil v nil p nil)
       (or (memq symbol '(apropos-regexp
                          apropos--current apropos-pattern-quoted pattern
                          apropos-pattern apropos-all-words-regexp
                          apropos-words apropos-all-words
                          apropos-accumulator))
           (setq v (apropos-value-internal #'boundp symbol #'symbol-value)))
       (if do-all
           (setq f (apropos-value-internal #'fboundp symbol #'symbol-function)
                 p (apropos-format-plist symbol "\n    " t)))
       (if (apropos-false-hit-str v)
           (setq v nil))
       (if (apropos-false-hit-str f)
           (setq f nil))
       (if (apropos-false-hit-str p)
           (setq p nil))
       (if (or f v p)
           (setq apropos-accumulator (cons (list symbol
                                                 (+ (apropos-score-str f)
                                                    (apropos-score-str v)
                                                    (apropos-score-str p))
                                                 f v p)
                                           apropos-accumulator))))))
  (let ((apropos-multi-type do-all))
    (apropos-print nil "\n")))