diff options
| author | Artur Malabarba | 2015-05-07 16:11:50 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-05-07 16:13:45 +0100 |
| commit | 14bb519f1034ddb38ce375cbad7095d9b07f8b26 (patch) | |
| tree | acf9714a9fd6e6f4c09e95ef72c62de6020eb2b2 | |
| parent | ad39858fae45452d39c7f37c3eaf0037fa5620b8 (diff) | |
| download | emacs-14bb519f1034ddb38ce375cbad7095d9b07f8b26.tar.gz emacs-14bb519f1034ddb38ce375cbad7095d9b07f8b26.zip | |
* lisp/emacs-lisp/package.el: New "external" package status
An external package is any installed package that's not built-in
and not from `package-user-dir', which usually means it's from an
entry in `package-directory-list'. They are treated much like
built-in packages, in that they cannot be through the Package Menu
deleted and are not considered for upgrades.
(package-desc-status): Identify if a package is installed outside
`package-user-dir'.
(package-menu--print-info-simple)
(package-menu--status-predicate): Add support for it.
* etc/NEWS: Document it.
| -rw-r--r-- | etc/NEWS | 11 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 7 |
2 files changed, 17 insertions, 1 deletions
| @@ -255,6 +255,17 @@ by default at least in Debian, for security reasons). | |||
| 255 | 255 | ||
| 256 | ** package.el | 256 | ** package.el |
| 257 | 257 | ||
| 258 | *** New "external" package status. | ||
| 259 | An external package is any installed package that's not built-in and | ||
| 260 | not from `package-user-dir', which usually means it's from an entry in | ||
| 261 | `package-directory-list'. They are treated much like built-in | ||
| 262 | packages, in that they cannot be through the Package Menu deleted and | ||
| 263 | are not considered for upgrades. | ||
| 264 | |||
| 265 | The effect, is that a user can manually place a specific version of a | ||
| 266 | package inside `package-directory-list' and the Package Menu will | ||
| 267 | always respect that. | ||
| 268 | |||
| 258 | *** If a package is available on multiple archives and one has higher | 269 | *** If a package is available on multiple archives and one has higher |
| 259 | priority (as per `package-archive-priorities') only that one is | 270 | priority (as per `package-archive-priorities') only that one is |
| 260 | listed. This can be configured with `package-menu-hide-low-priority'. | 271 | listed. This can be configured with `package-menu-hide-low-priority'. |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7968ecde127..615631383e7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -2457,7 +2457,9 @@ of these dependencies, similar to the list returned by | |||
| 2457 | (t "disabled")))) | 2457 | (t "disabled")))) |
| 2458 | (dir ;One of the installed packages. | 2458 | (dir ;One of the installed packages. |
| 2459 | (cond | 2459 | (cond |
| 2460 | ((not (file-exists-p (package-desc-dir pkg-desc))) "deleted") | 2460 | ((not (file-exists-p dir)) "deleted") |
| 2461 | ;; Not inside `package-user-dir'. | ||
| 2462 | ((not (file-in-directory-p dir package-user-dir)) "external") | ||
| 2461 | ((eq pkg-desc (cadr (assq name package-alist))) | 2463 | ((eq pkg-desc (cadr (assq name package-alist))) |
| 2462 | (if (not signed) "unsigned" | 2464 | (if (not signed) "unsigned" |
| 2463 | (if (package--user-selected-p name) | 2465 | (if (package--user-selected-p name) |
| @@ -2662,6 +2664,7 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." | |||
| 2662 | (let* ((status (package-desc-status pkg)) | 2664 | (let* ((status (package-desc-status pkg)) |
| 2663 | (face (pcase status | 2665 | (face (pcase status |
| 2664 | (`"built-in" 'font-lock-builtin-face) | 2666 | (`"built-in" 'font-lock-builtin-face) |
| 2667 | (`"external" 'font-lock-builtin-face) | ||
| 2665 | (`"available" 'default) | 2668 | (`"available" 'default) |
| 2666 | (`"avail-obso" 'font-lock-comment-face) | 2669 | (`"avail-obso" 'font-lock-comment-face) |
| 2667 | (`"new" 'bold) | 2670 | (`"new" 'bold) |
| @@ -2977,6 +2980,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." | |||
| 2977 | ((string= sB "unsigned") nil) | 2980 | ((string= sB "unsigned") nil) |
| 2978 | ((string= sA "held") t) | 2981 | ((string= sA "held") t) |
| 2979 | ((string= sB "held") nil) | 2982 | ((string= sB "held") nil) |
| 2983 | ((string= sA "external") t) | ||
| 2984 | ((string= sB "external") nil) | ||
| 2980 | ((string= sA "built-in") t) | 2985 | ((string= sA "built-in") t) |
| 2981 | ((string= sB "built-in") nil) | 2986 | ((string= sB "built-in") nil) |
| 2982 | ((string= sA "obsolete") t) | 2987 | ((string= sA "obsolete") t) |