Function: package--used-elsewhere-p
package--used-elsewhere-p is a byte-compiled function defined in
package.el.gz.
Signature
(package--used-elsewhere-p PKG-DESC &optional PKG-LIST ALL)
Documentation
Non-nil if PKG-DESC is a dependency of a package in PKG-LIST.
Return the first package found in PKG-LIST of which PKG is a dependency. If ALL is non-nil, return all such packages instead.
When not specified, PKG-LIST defaults to package-alist
with PKG-DESC entry removed.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package--used-elsewhere-p (pkg-desc &optional pkg-list all)
"Non-nil if PKG-DESC is a dependency of a package in PKG-LIST.
Return the first package found in PKG-LIST of which PKG is a
dependency. If ALL is non-nil, return all such packages instead.
When not specified, PKG-LIST defaults to `package-alist'
with PKG-DESC entry removed."
(unless (string= (package-desc-status pkg-desc) "obsolete")
(let* ((pkg (package-desc-name pkg-desc))
(alist (or pkg-list
(remove (assq pkg package-alist)
package-alist))))
(if all
(cl-loop for p in alist
if (assq pkg (package-desc-reqs (cadr p)))
collect (cadr p))
(cl-loop for p in alist thereis
(and (assq pkg (package-desc-reqs (cadr p)))
(cadr p)))))))