summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-12-10 19:56:03 +0200
committerEli Zaretskii <eliz@gnu.org>2013-12-10 19:56:03 +0200
commit5bdc6977e3ab4b36646671754098df7e6ab92ad6 (patch)
treedc240463c840e49e97c23fb58b9e2b3d4ad1f3f9 /lisp/emacs-lisp
parenta5c9bbb3413d8eea89cb832040a0ef6cd704dcfe (diff)
parente8374b3959e3fc809b7834e3b85245928ae83774 (diff)
downloademacs-5bdc6977e3ab4b36646671754098df7e6ab92ad6.tar.gz
emacs-5bdc6977e3ab4b36646671754098df7e6ab92ad6.tar.bz2
emacs-5bdc6977e3ab4b36646671754098df7e6ab92ad6.zip
Merge from trunk.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el41
1 files changed, 31 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 853c83e2fa2..f743ee4db9d 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1353,7 +1353,9 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(reqs (if desc (package-desc-reqs desc)))
(version (if desc (package-desc-version desc)))
(archive (if desc (package-desc-archive desc)))
- (homepage (if desc (cdr (assoc :url (package-desc-extras desc)))))
+ (extras (and desc (package-desc-extras desc)))
+ (homepage (cdr (assoc :url extras)))
+ (keywords (cdr (assoc :keywords extras)))
(built-in (eq pkg-dir 'builtin))
(installable (and archive (not built-in)))
(status (if desc (package-desc-status desc) "orphan"))
@@ -1392,15 +1394,10 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(insert (capitalize status))
(insert " from " (format "%s" archive))
(insert " -- ")
- (let ((button-text (if (display-graphic-p) "Install" "[Install]"))
- (button-face (if (display-graphic-p)
- '(:box (:line-width 2 :color "dark grey")
- :background "light grey"
- :foreground "black")
- 'link)))
- (insert-text-button button-text 'face button-face 'follow-link t
- 'package-desc desc
- 'action 'package-install-button-action)))
+ (package-make-button
+ "Install"
+ 'action 'package-install-button-action
+ 'package-desc desc))
(t (insert (capitalize status) ".")))
(insert "\n")
(insert " " (propertize "Archive" 'font-lock-face 'bold)
@@ -1433,6 +1430,15 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(insert " " (propertize "Homepage" 'font-lock-face 'bold) ": ")
(help-insert-xref-button homepage 'help-url homepage)
(insert "\n"))
+ (when keywords
+ (insert " " (propertize "Keywords" 'font-lock-face 'bold) ": ")
+ (dolist (k keywords)
+ (package-make-button
+ k
+ 'package-keyword k
+ 'action 'package-keyword-button-action)
+ (insert " "))
+ (insert "\n"))
(let* ((all-pkgs (append (cdr (assq name package-alist))
(cdr (assq name package-archive-contents))
(let ((bi (assq name package--builtins)))
@@ -1503,6 +1509,21 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(revert-buffer nil t)
(goto-char (point-min)))))
+(declare-function finder-list-matches "finder" (keyword))
+(defun package-keyword-button-action (button)
+ (let ((pkg-keyword (button-get button 'package-keyword)))
+ (finder-list-matches pkg-keyword)))
+
+(defun package-make-button (text &rest props)
+ (let ((button-text (if (display-graphic-p) text (concat "[" text "]")))
+ (button-face (if (display-graphic-p)
+ '(:box (:line-width 2 :color "dark grey")
+ :background "light grey"
+ :foreground "black")
+ 'link)))
+ (apply 'insert-text-button button-text 'face button-face 'follow-link t
+ props)))
+
;;;; Package menu mode.