summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-04-20 07:20:54 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-04-20 20:47:18 +0100
commitfad6b8a093c14bcf3f699878de501a1a7467cf4c (patch)
treed6fdb0f96fc2e082bdb2b6ff4795a3be80246c19 /lisp/emacs-lisp
parentc0f5a3b3352b748a276cf420b834d677f3d0a671 (diff)
downloademacs-fad6b8a093c14bcf3f699878de501a1a7467cf4c.tar.gz
* lisp/emacs-lisp/package.el: Make archive and status pseudo-keywords
(package--has-keyword-p): Understand "arc:xxxx" and "status:xxxx" as special keywords which match agains package archive and status respectively. * etc/NEWS: Document it.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 9cd6b3b9a66..4590582575f 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2535,12 +2535,14 @@ Built-in packages are converted with `package--from-builtin'."
"Test if package DESC has any of the given KEYWORDS.
When none are given, the package matches."
(if keywords
- (let* ((desc-keywords (and desc (package-desc--keywords desc)))
- found)
- (dolist (k keywords)
- (when (and (not found)
- (member k desc-keywords))
- (setq found t)))
+ (let ((desc-keywords (and desc (package-desc--keywords desc)))
+ found)
+ (while (and (not found) keywords)
+ (let ((k (pop keywords)))
+ (setq found
+ (or (string= k (concat "arc:" (package-desc-archive desc)))
+ (string= k (concat "status:" (package-desc-status desc)))
+ (member k desc-keywords)))))
found)
t))