Function: package-disabled-p
package-disabled-p is a byte-compiled function defined in
package.el.gz.
Signature
(package-disabled-p PKG-NAME VERSION)
Documentation
Return whether PKG-NAME at VERSION can be activated.
The decision is made according to package-load-list.
Return nil if the package can be activated.
Return t if the package is completely disabled.
Return the max version (as a string) if the package is held at a lower version.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
;;; Package activation
;; Section for functions used by `package-activate', which see.
(defun package-disabled-p (pkg-name version)
"Return whether PKG-NAME at VERSION can be activated.
The decision is made according to `package-load-list'.
Return nil if the package can be activated.
Return t if the package is completely disabled.
Return the max version (as a string) if the package is held at a lower version."
(let ((force (assq pkg-name package-load-list)))
(cond ((null force) (not (memq 'all package-load-list)))
((null (setq force (cadr force))) t) ; disabled
((eq force t) nil)
((stringp force) ; held
(unless (version-list-= version (version-to-list force))
force))
(t (error "Invalid element in `package-load-list'")))))