emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master fad6b8a 1/2: * lisp/emacs-lisp/package.el: Make arc


From: Artur Malabarba
Subject: [Emacs-diffs] master fad6b8a 1/2: * lisp/emacs-lisp/package.el: Make archive and status pseudo-keywords
Date: Mon, 20 Apr 2015 19:49:34 +0000

branch: master
commit fad6b8a093c14bcf3f699878de501a1a7467cf4c
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    * 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.
---
 etc/NEWS                   |    5 +++++
 lisp/emacs-lisp/package.el |   14 ++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index a9c0d2e..9dd0e15 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -238,6 +238,11 @@ in the surrounding GUI (using the OSC-52 escape sequence).
 ** xterm-mouse-mode now supports mouse-tracking (if your xterm supports it).
 
 ** package.el
+
+*** When filtering the package menu, keywords starting with "arc:" or
+"status:" represent package archive or status, respectively, instead
+of actual keywords.
+
 *** Most functions which involve downloading information now take an
 ASYNC argument.  If it is non-nil, package.el performs the download(s)
 asynchronously.
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 9cd6b3b..4590582 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))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]