summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-11 14:53:21 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-11 14:53:21 +0000
commite5d5cdff025255d3a983b448f2b64fd4e6131aef (patch)
tree37315dc4f43c56d4a2973a872121feefba4b0da4 /lisp
parent4fb5565d0a0cd9640a242028c92b8b4e2bd4683e (diff)
downloademacs-e5d5cdff025255d3a983b448f2b64fd4e6131aef.tar.gz
emacs-lisp/package.el: Indicate incompatible packages.
These are packages which require a higher emacs version than the current one.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/package.el19
2 files changed, 27 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7e45b9db64c..e6d2fe6ba8a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,15 @@
version of seq-reverse that works on sequences in Emacs 24.
Bump seq.el version to 1.2.
+2015-02-11 Artur Malabarba <bruce.connor.am@gmail.com>
+
+ * emacs-lisp/package.el (package--compatible-p): New function.
+ Return nil if PKG has no chance of being installable.
+ (package--emacs-version-list): New variable.
+ (describe-package-1, package-desc-status)
+ (package-menu--print-info, package-menu--status-predicate):
+ Account for the "incompat" status.
+
2015-02-11 Martin Rudalics <rudalics@gmx.at>
* frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index c3a2061aae2..49e125e0677 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."
(pkg-dir
(insert (propertize (if (member status '("unsigned" "dependency"))
"Installed"
- (capitalize status)) ;FIXME: Why comment-face?
+ (if (equal status "incompat")
+ "Incompatible"
+ (capitalize status))) ;FIXME: Why comment-face?
'font-lock-face 'font-lock-comment-face))
(insert " in `")
;; Todo: Add button for uninstalling.
@@ -2072,6 +2074,7 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
((version-list-< version hv) "obsolete")
(t "disabled"))))
((package-built-in-p name version) "obsolete")
+ ((not (package--compatible-p pkg-desc)) "incompat")
(dir ;One of the installed packages.
(cond
((not (file-exists-p (package-desc-dir pkg-desc))) "deleted")
@@ -2093,6 +2096,17 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
(if (package--user-selected-p name)
"installed" "dependency")))))))))
+(defvar package--emacs-version-list (version-to-list emacs-version)
+ "`emacs-version', as a list.")
+
+(defun package--compatible-p (pkg)
+ "Return nil if PKG has no chance of being installable.
+PKG is a package-desc object.
+Currently, only checks if PKG depends on a higher `emacs-version'
+than the one being used."
+ (when-let ((version (cdr-safe (assq 'emacs (package-desc-reqs pkg)))))
+ (version-list-<= version package--emacs-version-list)))
+
(defun package-menu--refresh (&optional packages keywords)
"Re-populate the `tabulated-list-entries'.
PACKAGES should be nil or t, which means to display all known packages.
@@ -2222,6 +2236,7 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])."
(`"installed" 'font-lock-comment-face)
(`"dependency" 'font-lock-comment-face)
(`"unsigned" 'font-lock-warning-face)
+ (`"incompat" 'font-lock-comment-face)
(_ 'font-lock-warning-face)))) ; obsolete.
(list pkg-desc
`[,(list (symbol-name (package-desc-name pkg-desc))
@@ -2494,6 +2509,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm."
((string= sB "built-in") nil)
((string= sA "obsolete") t)
((string= sB "obsolete") nil)
+ ((string= sA "incompat") t)
+ ((string= sB "incompat") nil)
(t (string< sA sB)))))
(defun package-menu--description-predicate (A B)