diff options
| author | Artur Malabarba | 2015-08-06 09:37:27 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-08-06 11:27:37 +0100 |
| commit | 1be349c628b9fedd6db96dcd5e3d9d1abb60e4d0 (patch) | |
| tree | e3aa44377647e77927e5a11e72e7e294304343f7 | |
| parent | 0c856a2c459016f1f9cce173f5b2b49be36e3452 (diff) | |
| download | emacs-1be349c628b9fedd6db96dcd5e3d9d1abb60e4d0.tar.gz emacs-1be349c628b9fedd6db96dcd5e3d9d1abb60e4d0.zip | |
* lisp/emacs-lisp/package.el: Define custom faces
(package-name-face, package-description-face)
(package-status-built-in-face, package-status-external-face)
(package-status-available-face, package-status-new-face)
(package-status-held-face, package-status-disabled-face)
(package-status-installed-face, package-status-dependency-face)
(package-status-unsigned-face, package-status-incompat-face)
(package-status-avail-obso-face): New faces.
(package-menu--print-info-simple): Use them.
| -rw-r--r-- | lisp/emacs-lisp/package.el | 97 |
1 files changed, 84 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 60977a7340c..492f8cc3e1a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -2741,27 +2741,97 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." | |||
| 2741 | (make-obsolete 'package-menu--print-info | 2741 | (make-obsolete 'package-menu--print-info |
| 2742 | 'package-menu--print-info-simple "25.1") | 2742 | 'package-menu--print-info-simple "25.1") |
| 2743 | 2743 | ||
| 2744 | |||
| 2745 | ;;; Package menu faces | ||
| 2746 | (defface package-name-face | ||
| 2747 | '((t :inherit link)) | ||
| 2748 | "Face used on package names in the package menu." | ||
| 2749 | :version "25.1") | ||
| 2750 | |||
| 2751 | (defface package-description-face | ||
| 2752 | '((t :inherit default)) | ||
| 2753 | "Face used on package description summaries in the package menu." | ||
| 2754 | :version "25.1") | ||
| 2755 | |||
| 2756 | (defface package-status-built-in-face | ||
| 2757 | '((t :inherit font-lock-builtin-face)) | ||
| 2758 | "Face used on the status and version of built-in packages." | ||
| 2759 | :version "25.1") | ||
| 2760 | |||
| 2761 | (defface package-status-external-face | ||
| 2762 | '((t :inherit package-status-builtin-face)) | ||
| 2763 | "Face used on the status and version of external packages." | ||
| 2764 | :version "25.1") | ||
| 2765 | |||
| 2766 | (defface package-status-available-face | ||
| 2767 | '((t :inherit default)) | ||
| 2768 | "Face used on the status and version of available packages." | ||
| 2769 | :version "25.1") | ||
| 2770 | |||
| 2771 | (defface package-status-new-face | ||
| 2772 | '((t :inherit (bold package-status-available-face))) | ||
| 2773 | "Face used on the status and version of new packages." | ||
| 2774 | :version "25.1") | ||
| 2775 | |||
| 2776 | (defface package-status-held-face | ||
| 2777 | '((t :inherit font-lock-constant-face)) | ||
| 2778 | "Face used on the status and version of held packages." | ||
| 2779 | :version "25.1") | ||
| 2780 | |||
| 2781 | (defface package-status-disabled-face | ||
| 2782 | '((t :inherit font-lock-warning-face)) | ||
| 2783 | "Face used on the status and version of disabled packages." | ||
| 2784 | :version "25.1") | ||
| 2785 | |||
| 2786 | (defface package-status-installed-face | ||
| 2787 | '((t :inherit font-lock-comment-face)) | ||
| 2788 | "Face used on the status and version of installed packages." | ||
| 2789 | :version "25.1") | ||
| 2790 | |||
| 2791 | (defface package-status-dependency-face | ||
| 2792 | '((t :inherit package-status-installed-face)) | ||
| 2793 | "Face used on the status and version of dependency packages." | ||
| 2794 | :version "25.1") | ||
| 2795 | |||
| 2796 | (defface package-status-unsigned-face | ||
| 2797 | '((t :inherit font-lock-warning-face)) | ||
| 2798 | "Face used on the status and version of unsigned packages." | ||
| 2799 | :version "25.1") | ||
| 2800 | |||
| 2801 | (defface package-status-incompat-face | ||
| 2802 | '((t :inherit font-lock-comment-face)) | ||
| 2803 | "Face used on the status and version of incompat packages." | ||
| 2804 | :version "25.1") | ||
| 2805 | |||
| 2806 | (defface package-status-avail-obso-face | ||
| 2807 | '((t :inherit package-status-incompat-face)) | ||
| 2808 | "Face used on the status and version of avail-obso packages." | ||
| 2809 | :version "25.1") | ||
| 2810 | |||
| 2811 | |||
| 2812 | ;;; Package menu printing | ||
| 2744 | (defun package-menu--print-info-simple (pkg) | 2813 | (defun package-menu--print-info-simple (pkg) |
| 2745 | "Return a package entry suitable for `tabulated-list-entries'. | 2814 | "Return a package entry suitable for `tabulated-list-entries'. |
| 2746 | PKG is a package-desc object. | 2815 | PKG is a package-desc object. |
| 2747 | Return (PKG-DESC [NAME VERSION STATUS DOC])." | 2816 | Return (PKG-DESC [NAME VERSION STATUS DOC])." |
| 2748 | (let* ((status (package-desc-status pkg)) | 2817 | (let* ((status (package-desc-status pkg)) |
| 2749 | (face (pcase status | 2818 | (face (pcase status |
| 2750 | (`"built-in" 'font-lock-builtin-face) | 2819 | (`"built-in" 'package-status-built-in-face) |
| 2751 | (`"external" 'font-lock-builtin-face) | 2820 | (`"external" 'package-status-external-face) |
| 2752 | (`"available" 'default) | 2821 | (`"available" 'package-status-available-face) |
| 2753 | (`"avail-obso" 'font-lock-comment-face) | 2822 | (`"avail-obso" 'package-status-avail-obso-face) |
| 2754 | (`"new" 'bold) | 2823 | (`"new" 'package-status-new-face) |
| 2755 | (`"held" 'font-lock-constant-face) | 2824 | (`"held" 'package-status-held-face) |
| 2756 | (`"disabled" 'font-lock-warning-face) | 2825 | (`"disabled" 'package-status-disabled-face) |
| 2757 | (`"installed" 'font-lock-comment-face) | 2826 | (`"installed" 'package-status-installed-face) |
| 2758 | (`"dependency" 'font-lock-comment-face) | 2827 | (`"dependency" 'package-status-dependency-face) |
| 2759 | (`"unsigned" 'font-lock-warning-face) | 2828 | (`"unsigned" 'package-status-unsigned-face) |
| 2760 | (`"incompat" 'font-lock-comment-face) | 2829 | (`"incompat" 'package-status-incompat-face) |
| 2761 | (_ 'font-lock-warning-face)))) ; obsolete. | 2830 | (_ 'font-lock-warning-face)))) ; obsolete. |
| 2762 | (list pkg | 2831 | (list pkg |
| 2763 | `[(,(symbol-name (package-desc-name pkg)) | 2832 | `[(,(symbol-name (package-desc-name pkg)) |
| 2764 | face link | 2833 | face package-name-face |
| 2834 | font-lock-face package-name-face | ||
| 2765 | follow-link t | 2835 | follow-link t |
| 2766 | package-desc ,pkg | 2836 | package-desc ,pkg |
| 2767 | action package-menu-describe-package) | 2837 | action package-menu-describe-package) |
| @@ -2772,7 +2842,8 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." | |||
| 2772 | ,@(if (cdr package-archives) | 2842 | ,@(if (cdr package-archives) |
| 2773 | (list (propertize (or (package-desc-archive pkg) "") | 2843 | (list (propertize (or (package-desc-archive pkg) "") |
| 2774 | 'font-lock-face face))) | 2844 | 'font-lock-face face))) |
| 2775 | ,(package-desc-summary pkg)]))) | 2845 | ,(propertize (package-desc-summary pkg) |
| 2846 | 'font-lock-face 'package-description-face)]))) | ||
| 2776 | 2847 | ||
| 2777 | (defvar package-menu--old-archive-contents nil | 2848 | (defvar package-menu--old-archive-contents nil |
| 2778 | "`package-archive-contents' before the latest refresh.") | 2849 | "`package-archive-contents' before the latest refresh.") |