diff options
| author | Artur Malabarba | 2015-04-12 03:08:21 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-04-12 03:09:50 +0100 |
| commit | 6f87b180dd947da509a0737afee97531df107bb7 (patch) | |
| tree | 840b811de18e3f612523f103b7ed5501a0fefcfa | |
| parent | 357edb4e89e9a6a9a436f88d83cd2bc7c9da29eb (diff) | |
| download | emacs-6f87b180dd947da509a0737afee97531df107bb7.tar.gz emacs-6f87b180dd947da509a0737afee97531df107bb7.zip | |
* lisp/emacs-lisp/package.el: Improve package-menu-quick-help
(package--quick-help-keys): New variable.
(package--prettify-quick-help-key): New function.
(package-menu-quick-help): Use it.
| -rw-r--r-- | lisp/emacs-lisp/package.el | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8920bf6a81d..745c5bf5dc4 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -2639,10 +2639,31 @@ If optional arg BUTTON is non-nil, describe its associated package." | |||
| 2639 | (tabulated-list-put-tag "D" t) | 2639 | (tabulated-list-put-tag "D" t) |
| 2640 | (forward-line 1))))) | 2640 | (forward-line 1))))) |
| 2641 | 2641 | ||
| 2642 | (defvar package--quick-help-keys | ||
| 2643 | '(("install," "delete," "unmark," ("execute" . 1)) | ||
| 2644 | ("next," "previous") | ||
| 2645 | ("refresh-contents," "g-redisplay," "filter," "help"))) | ||
| 2646 | |||
| 2647 | (defun package--prettify-quick-help-key (desc) | ||
| 2648 | "Prettify DESC to be displayed as a help menu." | ||
| 2649 | (if (listp desc) | ||
| 2650 | (if (listp (cdr desc)) | ||
| 2651 | (mapconcat #'package--prettify-quick-help-key desc " ") | ||
| 2652 | (let ((place (cdr desc)) | ||
| 2653 | (out (car desc))) | ||
| 2654 | ;; (setq out (propertize out 'face 'paradox-comment-face)) | ||
| 2655 | (add-text-properties place (1+ place) | ||
| 2656 | '(face (bold font-lock-function-name-face)) | ||
| 2657 | out) | ||
| 2658 | out)) | ||
| 2659 | (package--prettify-quick-help-key (cons desc 0)))) | ||
| 2660 | |||
| 2642 | (defun package-menu-quick-help () | 2661 | (defun package-menu-quick-help () |
| 2643 | "Show short key binding help for package-menu-mode." | 2662 | "Show short key binding help for `package-menu-mode'. |
| 2663 | The full list of keys can be viewed with \\[describe-mode]." | ||
| 2644 | (interactive) | 2664 | (interactive) |
| 2645 | (message "n-ext, i-nstall, d-elete, u-nmark, x-ecute, r-efresh, h-elp")) | 2665 | (message (mapconcat #'package--prettify-quick-help-key |
| 2666 | package--quick-help-keys "\n"))) | ||
| 2646 | 2667 | ||
| 2647 | (define-obsolete-function-alias | 2668 | (define-obsolete-function-alias |
| 2648 | 'package-menu-view-commentary 'package-menu-describe-package "24.1") | 2669 | 'package-menu-view-commentary 'package-menu-describe-package "24.1") |