aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Malabarba2015-02-11 14:53:21 +0000
committerArtur Malabarba2015-02-12 00:14:46 -0200
commit511acc77a4b0be3ed997c335f270b346a4ed0d5f (patch)
treec539b21e28a2b6eae22d32ccfd71b328ce6ee418
parent0a66ca36fa052fbd7c0c751c96c22b5d81dec658 (diff)
downloademacs-511acc77a4b0be3ed997c335f270b346a4ed0d5f.tar.gz
emacs-511acc77a4b0be3ed997c335f270b346a4ed0d5f.zip
emacs-lisp/package.el: Indicate incompatible packages.
These are packages which require a higher emacs version than the current one.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/package.el27
2 files changed, 35 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index def4620db02..6c51e2aee98 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -16,6 +16,15 @@
16 version of seq-reverse that works on sequences in Emacs 24. 16 version of seq-reverse that works on sequences in Emacs 24.
17 Bump seq.el version to 1.2. 17 Bump seq.el version to 1.2.
18 18
192015-02-11 Artur Malabarba <bruce.connor.am@gmail.com>
20
21 * emacs-lisp/package.el (package--incompatible-p): New function.
22 Return non-nil if PKG has no chance of being installable.
23 (package--emacs-version-list): New variable.
24 (describe-package-1, package-desc-status)
25 (package-menu--print-info, package-menu--status-predicate):
26 Account for the "incompat" status.
27
192015-02-11 Martin Rudalics <rudalics@gmx.at> 282015-02-11 Martin Rudalics <rudalics@gmx.at>
20 29
21 * frame.el (toggle-frame-maximized, toggle-frame-fullscreen): 30 * frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 60cf65d2305..67e2f4050a7 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1796,7 +1796,9 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1796 (pkg-dir 1796 (pkg-dir
1797 (insert (propertize (if (member status '("unsigned" "dependency")) 1797 (insert (propertize (if (member status '("unsigned" "dependency"))
1798 "Installed" 1798 "Installed"
1799 (capitalize status)) ;FIXME: Why comment-face? 1799 (if (equal status "incompat")
1800 "Incompatible"
1801 (capitalize status))) ;FIXME: Why comment-face?
1800 'font-lock-face 'font-lock-comment-face)) 1802 'font-lock-face 'font-lock-comment-face))
1801 (insert " in `") 1803 (insert " in `")
1802 ;; Todo: Add button for uninstalling. 1804 ;; Todo: Add button for uninstalling.
@@ -2054,6 +2056,25 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
2054(defvar package-list-unsigned nil 2056(defvar package-list-unsigned nil
2055 "If non-nil, mention in the list which packages were installed w/o signature.") 2057 "If non-nil, mention in the list which packages were installed w/o signature.")
2056 2058
2059(defvar package--emacs-version-list (version-to-list emacs-version)
2060 "`emacs-version', as a list.")
2061
2062(defun package--incompatible-p (pkg)
2063 "Return non-nil if PKG has no chance of being installable.
2064PKG is a package-desc object.
2065Return value is a string describing the reason why the package is
2066incompatible.
2067
2068Currently, this only checks if PKG depends on a higher
2069`emacs-version' than the one being used."
2070 (let* ((reqs (package-desc-reqs pkg))
2071 (version (cadr (assq 'emacs reqs))))
2072 (if (and version (version-list-< package--emacs-version-list version))
2073 (format "`%s' requires Emacs %s, but current version is %s"
2074 (package-desc-full-name pkg)
2075 (package-version-join version)
2076 emacs-version))))
2077
2057(defun package-desc-status (pkg-desc) 2078(defun package-desc-status (pkg-desc)
2058 (let* ((name (package-desc-name pkg-desc)) 2079 (let* ((name (package-desc-name pkg-desc))
2059 (dir (package-desc-dir pkg-desc)) 2080 (dir (package-desc-dir pkg-desc))
@@ -2072,6 +2093,7 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
2072 ((version-list-< version hv) "obsolete") 2093 ((version-list-< version hv) "obsolete")
2073 (t "disabled")))) 2094 (t "disabled"))))
2074 ((package-built-in-p name version) "obsolete") 2095 ((package-built-in-p name version) "obsolete")
2096 ((package--incompatible-p pkg-desc) "incompat")
2075 (dir ;One of the installed packages. 2097 (dir ;One of the installed packages.
2076 (cond 2098 (cond
2077 ((not (file-exists-p (package-desc-dir pkg-desc))) "deleted") 2099 ((not (file-exists-p (package-desc-dir pkg-desc))) "deleted")
@@ -2222,6 +2244,7 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])."
2222 (`"installed" 'font-lock-comment-face) 2244 (`"installed" 'font-lock-comment-face)
2223 (`"dependency" 'font-lock-comment-face) 2245 (`"dependency" 'font-lock-comment-face)
2224 (`"unsigned" 'font-lock-warning-face) 2246 (`"unsigned" 'font-lock-warning-face)
2247 (`"incompat" 'font-lock-comment-face)
2225 (_ 'font-lock-warning-face)))) ; obsolete. 2248 (_ 'font-lock-warning-face)))) ; obsolete.
2226 (list pkg-desc 2249 (list pkg-desc
2227 `[,(list (symbol-name (package-desc-name pkg-desc)) 2250 `[,(list (symbol-name (package-desc-name pkg-desc))
@@ -2492,6 +2515,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm."
2492 ((string= sB "built-in") nil) 2515 ((string= sB "built-in") nil)
2493 ((string= sA "obsolete") t) 2516 ((string= sA "obsolete") t)
2494 ((string= sB "obsolete") nil) 2517 ((string= sB "obsolete") nil)
2518 ((string= sA "incompat") t)
2519 ((string= sB "incompat") nil)
2495 (t (string< sA sB))))) 2520 (t (string< sA sB)))))
2496 2521
2497(defun package-menu--description-predicate (A B) 2522(defun package-menu--description-predicate (A B)