diff options
| author | Stefan Monnier | 2013-06-22 16:09:19 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-06-22 16:09:19 -0400 |
| commit | 5b165ade1eff0fd62ac22f9b3ccf84933d15c61a (patch) | |
| tree | 8ac1a04a98ae67e01283375f0f926f74316091a0 /lisp | |
| parent | 0dfeed58d3244487a545bb4d4e19658eb299937b (diff) | |
| download | emacs-5b165ade1eff0fd62ac22f9b3ccf84933d15c61a.tar.gz emacs-5b165ade1eff0fd62ac22f9b3ccf84933d15c61a.zip | |
* lisp/emacs-lisp/package.el (package-el-version): Remove.
(package-process-define-package): Fix inf-loop.
(package-install): Allow symbols as arguments again.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 42 |
2 files changed, 26 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c41e712226..0d69ca18dfa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-06-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/package.el (package-el-version): Remove. | ||
| 4 | (package-process-define-package): Fix inf-loop. | ||
| 5 | (package-install): Allow symbols as arguments again. | ||
| 6 | |||
| 1 | 2013-06-22 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2013-06-22 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * progmodes/ruby-mode.el (ruby-font-lock-keywords): Move `catch', | 9 | * progmodes/ruby-mode.el (ruby-font-lock-keywords): Move `catch', |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index e5833703ad5..37f20e0cfed 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -233,7 +233,7 @@ a package can run arbitrary code." | |||
| 233 | 233 | ||
| 234 | Each element has the form (SYM . ID). | 234 | Each element has the form (SYM . ID). |
| 235 | SYM is a package, as a symbol. | 235 | SYM is a package, as a symbol. |
| 236 | ID is an archive name, as a string. This should correspond to an | 236 | ID is an archive name. This should correspond to an |
| 237 | entry in `package-archives'. | 237 | entry in `package-archives'. |
| 238 | 238 | ||
| 239 | If the archive of name ID does not contain the package SYM, no | 239 | If the archive of name ID does not contain the package SYM, no |
| @@ -249,9 +249,6 @@ package unavailable." | |||
| 249 | "Version number of the package archive understood by this file. | 249 | "Version number of the package archive understood by this file. |
| 250 | Lower version numbers than this will probably be understood as well.") | 250 | Lower version numbers than this will probably be understood as well.") |
| 251 | 251 | ||
| 252 | (defconst package-el-version "1.0.1" | ||
| 253 | "Version of package.el.") | ||
| 254 | |||
| 255 | ;; We don't prime the cache since it tends to get out of date. | 252 | ;; We don't prime the cache since it tends to get out of date. |
| 256 | (defvar package-archive-contents nil | 253 | (defvar package-archive-contents nil |
| 257 | "Cache of the contents of the Emacs Lisp Package Archive. | 254 | "Cache of the contents of the Emacs Lisp Package Archive. |
| @@ -557,13 +554,13 @@ EXTRA-PROPERTIES is currently unused." | |||
| 557 | ;; If there's no old package, just add this to `package-alist'. | 554 | ;; If there's no old package, just add this to `package-alist'. |
| 558 | (push (list name new-pkg-desc) package-alist) | 555 | (push (list name new-pkg-desc) package-alist) |
| 559 | ;; If there is, insert the new package at the right place in the list. | 556 | ;; If there is, insert the new package at the right place in the list. |
| 560 | (while old-pkgs | 557 | (while |
| 561 | (cond | 558 | (if (and (cdr old-pkgs) |
| 562 | ((null (cdr old-pkgs)) (push new-pkg-desc (cdr old-pkgs))) | 559 | (version-list-< version |
| 563 | ((version-list-< (package-desc-version (cadr old-pkgs)) version) | 560 | (package-desc-version (cadr old-pkgs)))) |
| 564 | (push new-pkg-desc (cdr old-pkgs)) | 561 | (setq old-pkgs (cdr old-pkgs)) |
| 565 | (setq old-pkgs nil))) | 562 | (push new-pkg-desc (cdr old-pkgs)) |
| 566 | (setq old-pkgs (cdr old-pkgs)))) | 563 | nil))) |
| 567 | new-pkg-desc)) | 564 | new-pkg-desc)) |
| 568 | 565 | ||
| 569 | ;; From Emacs 22, but changed so it adds to load-path. | 566 | ;; From Emacs 22, but changed so it adds to load-path. |
| @@ -914,10 +911,10 @@ using `package-compute-transaction'." | |||
| 914 | (package-install-from-archive desc)))) | 911 | (package-install-from-archive desc)))) |
| 915 | 912 | ||
| 916 | ;;;###autoload | 913 | ;;;###autoload |
| 917 | (defun package-install (pkg-desc) | 914 | (defun package-install (pkg) |
| 918 | "Install the package PKG-DESC. | 915 | "Install the package PKG. |
| 919 | PKG-DESC should be one of the available packages in an | 916 | PKG can be a package-desc or the package name of one the available packages |
| 920 | archive in `package-archives'. Interactively, prompt for its name." | 917 | in an archive in `package-archives'. Interactively, prompt for its name." |
| 921 | (interactive | 918 | (interactive |
| 922 | (progn | 919 | (progn |
| 923 | ;; Initialize the package system to get the list of package | 920 | ;; Initialize the package system to get the list of package |
| @@ -926,22 +923,22 @@ archive in `package-archives'. Interactively, prompt for its name." | |||
| 926 | (package-initialize t)) | 923 | (package-initialize t)) |
| 927 | (unless package-archive-contents | 924 | (unless package-archive-contents |
| 928 | (package-refresh-contents)) | 925 | (package-refresh-contents)) |
| 929 | (let* ((name (intern (completing-read | 926 | (list (intern (completing-read |
| 930 | "Install package: " | 927 | "Install package: " |
| 931 | (mapcar (lambda (elt) | 928 | (mapcar (lambda (elt) |
| 932 | (cons (symbol-name (car elt)) | 929 | (cons (symbol-name (car elt)) |
| 933 | nil)) | 930 | nil)) |
| 934 | package-archive-contents) | 931 | package-archive-contents) |
| 935 | nil t))) | 932 | nil t))))) |
| 936 | (pkg-desc (cdr (assq name package-archive-contents)))) | 933 | (let ((pkg-desc |
| 934 | (if (package-desc-p pkg) pkg | ||
| 935 | (cdr (assq pkg package-archive-contents))))) | ||
| 937 | (unless pkg-desc | 936 | (unless pkg-desc |
| 938 | (error "Package `%s' is not available for installation" | 937 | (error "Package `%s' is not available for installation" pkg)) |
| 939 | name)) | ||
| 940 | (list pkg-desc)))) | ||
| 941 | (package-download-transaction | 938 | (package-download-transaction |
| 942 | ;; FIXME: Use (list pkg-desc) instead of just the name. | 939 | ;; FIXME: Use (list pkg-desc) instead of just the name. |
| 943 | (package-compute-transaction (list (package-desc-name pkg-desc)) | 940 | (package-compute-transaction (list (package-desc-name pkg-desc)) |
| 944 | (package-desc-reqs pkg-desc)))) | 941 | (package-desc-reqs pkg-desc))))) |
| 945 | 942 | ||
| 946 | (defun package-strip-rcs-id (str) | 943 | (defun package-strip-rcs-id (str) |
| 947 | "Strip RCS version ID from the version string STR. | 944 | "Strip RCS version ID from the version string STR. |
| @@ -1082,6 +1079,7 @@ similar to an entry in `package-alist'. Save the cached copy to | |||
| 1082 | This informs Emacs about the latest versions of all packages, and | 1079 | This informs Emacs about the latest versions of all packages, and |
| 1083 | makes them available for download." | 1080 | makes them available for download." |
| 1084 | (interactive) | 1081 | (interactive) |
| 1082 | ;; FIXME: Do it asynchronously. | ||
| 1085 | (unless (file-exists-p package-user-dir) | 1083 | (unless (file-exists-p package-user-dir) |
| 1086 | (make-directory package-user-dir t)) | 1084 | (make-directory package-user-dir t)) |
| 1087 | (dolist (archive package-archives) | 1085 | (dolist (archive package-archives) |