Function: package--user-installed-p
package--user-installed-p is a byte-compiled function defined in
package.el.gz.
Signature
(package--user-installed-p PACKAGE)
Documentation
Return non-nil if PACKAGE is a user-installed package.
PACKAGE is the package name, a symbol. Check whether the package
was installed into package-user-dir where we assume to have
control over.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package--user-installed-p (package)
"Return non-nil if PACKAGE is a user-installed package.
PACKAGE is the package name, a symbol. Check whether the package
was installed into `package-user-dir' where we assume to have
control over."
(let* ((pkg-desc (cadr (assq package package-alist)))
(dir (package-desc-dir pkg-desc)))
(file-in-directory-p dir package-user-dir)))