Add prelude-show-foreign-packages

This commit is contained in:
Bozhidar Batsov 2013-09-27 13:19:29 +03:00
parent 239571f17b
commit 0dbb140fbd

View file

@ -56,6 +56,8 @@
(defun prelude-require-package (package)
"Install PACKAGE unless already installed."
(unless (memq package prelude-packages)
(add-to-list 'prelude-packages package))
(unless (package-installed-p package)
(package-install package)))
@ -76,8 +78,19 @@ Missing packages are installed automatically."
;; install the missing packages
(prelude-require-packages prelude-packages)))
;; run package installation
(prelude-install-packages)
(defun prelude-list-foreign-packages ()
"Browse third-party packages not bundled with Prelude.
Behaves similarly to `package-list-packages', but shows only the packages that
are installed and are not in `prelude-packages'. Useful for
removing unwanted packages."
(interactive)
(package-show-package-list
(set-difference package-activated-list prelude-packages)))
(defmacro prelude-auto-install (extension package mode)
"When file with EXTENSION is opened triggers auto-install of PACKAGE.
PACKAGE is installed only if not already present. The file is opened in MODE."