Function: cond*-used-within
cond*-used-within is a byte-compiled function defined in
cond-star.el.gz.
Signature
(cond*-used-within BINDINGS EXP)
Documentation
Return the list of those bindings in BINDINGS which EXP refers to.
This operates naively and errs on the side of overinclusion, and does not distinguish function names from variable names. That is safe for the purpose this is used for.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/cond-star.el.gz
(defun cond*-used-within (bindings exp)
"Return the list of those bindings in BINDINGS which EXP refers to.
This operates naively and errs on the side of overinclusion,
and does not distinguish function names from variable names.
That is safe for the purpose this is used for."
(cond ((symbolp exp)
(let ((which (assq exp bindings)))
(if which (list which))))
((listp exp)
(let (combined (rest exp))
;; Find the bindings used in each element of EXP
;; and merge them together in COMBINED.
;; It would be simpler to use dolist at each level,
;; but this avoids errors from improper lists.
(while rest
(let ((in-this-elt (cond*-used-within bindings (car rest))))
(while in-this-elt
;; Don't insert the same binding twice.
(unless (memq (car-safe in-this-elt) combined)
(push (car-safe in-this-elt) combined))
(pop in-this-elt)))
(pop rest))
combined))))