summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-06-15 11:36:11 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-06-15 11:36:11 -0400
commit66bd25ab33bd0b8ddf6d2ced9c5910721f0b9cfb (patch)
treec38c696001eba80c383bf1c2e7526922a81af0b8 /lisp/startup.el
parentd862673b610c728ce1b4402c0c88b73c2fbd2f42 (diff)
downloademacs-66bd25ab33bd0b8ddf6d2ced9c5910721f0b9cfb.tar.gz
* lisp/emacs-lisp/package.el: Don't activate packages older than builtin.
(package-obsolete-list): Rename from package-obsolete-alist, and make it into a simple list of package-desc. (package-strip-version): Remove. (package-built-in-p): Use package--builtin-versions. (package-mark-obsolete): Simplify. (package-process-define-package): Mark it obsolete if older than the builtin version. (package-handle-response): Use line-end-position. (package-read-archive-contents, package--download-one-archive): Simplify. (package--add-to-archive-contents): Skip if older than the builtin or installed version. (package-menu-describe-package): Fix last change. (package-list-unversioned): New var. (package-menu--generate): Use it. * lisp/Makefile.in (autoloads): Set autoload-builtin-package-versions. * lisp/startup.el (package--builtin-versions): New var. (package-subdirectory-regexp): Remove. (package--description-file): Hard code its value instead. * lisp/emacs-lisp/autoload.el: Manage package--builtin-versions. (autoload--insert-text, autoload--insert-cookie-text): New functions. (autoload-builtin-package-versions): New variable. (autoload-generate-file-autoloads): Use them. Remove the list of autoloaded functions/macros from the (autoload...) comments.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index bd1e0db03e6..52dd6b074ba 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -413,19 +413,18 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
:type 'directory
:initialize 'custom-initialize-delay)
-(defconst package-subdirectory-regexp
- "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)"
- "Regular expression matching the name of a package subdirectory.
-The first subexpression is the package name.
-The second subexpression is the version string.
-
-The regexp should not contain a starting \"\\`\" or a trailing
- \"\\'\"; those are added automatically by callers.")
+(defvar package--builtin-versions
+ ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions.
+ (purecopy `((emacs . ,(version-to-list emacs-version))))
+ "Alist giving the version of each versioned builtin package.
+I.e. each element of the list is of the form (NAME . VERSION) where
+NAME is the package name as a symbol, and VERSION is its version
+as a list.")
(defun package--description-file (dir)
(concat (let ((subdir (file-name-nondirectory
(directory-file-name dir))))
- (if (string-match package-subdirectory-regexp subdir)
+ (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)" subdir)
(match-string 1 subdir) subdir))
"-pkg.el"))