Created
January 28, 2012 15:15
-
-
Save purcell/1694669 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar package-filter-function nil | |
"Optional predicate function used to internally filter packages used by package.el. | |
The function is called with the arguments PACKAGE VERSION ARCHIVE, where | |
PACKAGE is a symbol, VERSION is a vector as produced by `version-to-list', and | |
ARCHIVE is the string name of the package archive.") | |
(defadvice package--add-to-archive-contents | |
(around filter-packages (package archive) activate) | |
"Add filtering of available packages using `package-filter-function', if non-nil." | |
(when (or (null package-filter-function) | |
(funcall package-filter-function | |
(car package) | |
(package-desc-vers (cdr package)) | |
archive)) | |
ad-do-it)) | |
;; Only take certain packages from Melpa | |
(setq package-filter-function | |
(lambda (package version archive) | |
(or (not (string-equal archive "melpa")) | |
(memq package '(magit rvm slime))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment