diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-11 14:53:43 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-11 14:53:43 +0000 |
commit | 0d9dcefc09b0659faf5466831e87301719708561 (patch) | |
tree | 37eff0c011ff57255646de0a702966ac2d8e2590 /lisp | |
parent | e5d5cdff025255d3a983b448f2b64fd4e6131aef (diff) | |
download | emacs-0d9dcefc09b0659faf5466831e87301719708561.tar.gz |
emacs-lisp/package.el (package-install): Invert the second argument.scratch/package-fix
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 7 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 28 |
2 files changed, 20 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e6d2fe6ba8a..a11e521bd15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-02-11 Artur Malabarba <bruce.connor.am@gmail.com> + + * emacs-lisp/package.el (package-install): Invert the second + argument, for better backwards compatibility. + (package-install-button-action, package-reinstall) + (package-menu-execute): Account for the change. + 2015-02-11 Nicolas Petton <nicolas@petton.fr> * emacs-lisp/seq.el (seq-reverse): Add a backward-compatible diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 49e125e0677..4fef228a5a5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1221,15 +1221,15 @@ using `package-compute-transaction'." (mapc #'package-install-from-archive packages)) ;;;###autoload -(defun package-install (pkg &optional mark-selected) +(defun package-install (pkg &optional dont-select) "Install the package PKG. PKG can be a package-desc or the package name of one the available packages in an archive in `package-archives'. Interactively, prompt for its name. -If called interactively or if MARK-SELECTED is non-nil, add PKG -to `package-selected-packages'. +If called interactively or if DONT-SELECT nil, add PKG to +`package-selected-packages'. -if PKG is a package-desc and it is already installed, don't try +If PKG is a package-desc and it is already installed, don't try to install it but still mark it as selected." (interactive (progn @@ -1247,11 +1247,11 @@ to install it but still mark it as selected." (symbol-name (car elt)))) package-archive-contents)) nil t)) - t))) + nil))) (let ((name (if (package-desc-p pkg) (package-desc-name pkg) pkg))) - (when (and mark-selected (not (package--user-selected-p name))) + (unless (or dont-select (package--user-selected-p name)) (customize-save-variable 'package-selected-packages (cons name package-selected-packages)))) (if (package-desc-p pkg) @@ -1276,7 +1276,7 @@ object." (package-delete (if (package-desc-p pkg) pkg (cadr (assq pkg package-alist))) 'force 'nosave) - (package-install pkg)) + (package-install pkg 'dont-select)) (defun package-strip-rcs-id (str) "Strip RCS version ID from the version string STR. @@ -1931,7 +1931,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages." (let ((pkg-desc (button-get button 'package-desc))) (when (y-or-n-p (format "Install package `%s'? " (package-desc-full-name pkg-desc))) - (package-install pkg-desc 1) + (package-install pkg-desc nil) (revert-buffer nil t) (goto-char (point-min))))) @@ -2442,13 +2442,11 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." (mapconcat #'package-desc-full-name install-list ", "))))) (mapc (lambda (p) - ;; Mark as selected if it's the exact version of a - ;; package that's already installed, or if it's not - ;; installed at all. Don't mark if it's a new - ;; version of an installed package. - (package-install p (or (package-installed-p p) - (not (package-installed-p - (package-desc-name p)))))) + ;; Don't mark as selected if it's a new version of + ;; an installed package. + (package-install p (and (not (package-installed-p p)) + (package-installed-p + (package-desc-name p))))) install-list))) ;; Delete packages, prompting if necessary. (when delete-list |