Commit 5c92e00d authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/emacs-lisp/package.el (package-desc-keywords): New function.

(describe-package-1, package-all-keywords)
(package--has-keyword-p): Use it.

Fixes: debbugs:16222
parent 39c87140
2014-01-15 Dmitry Gutov <>
* emacs-lisp/package.el (package-desc-keywords): New function
(describe-package-1, package-all-keywords)
(package--has-keyword-p): Use it.
2014-01-14 Nicolas Richard <>
* simple.el (define-alternatives): When creating the
......@@ -332,7 +332,10 @@ contrast, `package-user-dir' contains packages for personal use."
(unless (memq (car rest-plist) '(:kind :archive))
(let ((value (cadr rest-plist)))
(when value
(push (cons (car rest-plist) value)
(push (cons (car rest-plist)
(if (eq (car-safe value) 'quote)
(cdr value)
(setq rest-plist (cddr rest-plist)))
......@@ -384,6 +387,12 @@ Slots:
(`tar ".tar")
(kind (error "Unknown package kind: %s" kind))))
(defun package-desc-keywords (pkg-desc)
(let ((keywords (assoc :keywords (package-desc-extras pkg-desc))))
(if (eq (car-safe keywords) 'quote)
(cdr keywords)
;; Package descriptor format used in finder-inf.el and package--builtins.
(cl-defstruct (package--bi-desc
(:constructor package-make-builtin (version summary))
......@@ -1378,7 +1387,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(archive (if desc (package-desc-archive desc)))
(extras (and desc (package-desc-extras desc)))
(homepage (cdr (assoc :url extras)))
(keywords (cdr (assoc :keywords extras)))
(keywords (if desc (package-desc-keywords desc)))
(built-in (eq pkg-dir 'builtin))
(installable (and archive (not built-in)))
(status (if desc (package-desc-status desc) "orphan"))
......@@ -1729,7 +1738,7 @@ KEYWORDS should be nil or a list of keywords."
(let (keywords)
(package--mapc (lambda (desc)
(let* ((extras (and desc (package-desc-extras desc)))
(desc-keywords (cdr (assoc :keywords extras))))
(desc-keywords (and desc (package-desc-keywords desc))))
(setq keywords (append keywords desc-keywords)))))
......@@ -1771,7 +1780,7 @@ Built-in packages are converted with `package--from-builtin'."
When none are given, the package matches."
(if keywords
(let* ((extras (and desc (package-desc-extras desc)))
(desc-keywords (cdr (assoc :keywords extras)))
(desc-keywords (and desc (package-desc-keywords desc)))
(dolist (k keywords)
(when (and (not found)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment