From 0a66ca36fa052fbd7c0c751c96c22b5d81dec658 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 11 Feb 2015 14:53:43 +0000 Subject: [PATCH] emacs-lisp/package.el (package-install): Invert the second argument. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/package.el | 28 +++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34e4e9d1c2b..def4620db02 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,13 @@ * hi-lock.el (hi-lock-unface-buffer): Don't call font-lock-remove-keywords if not needed (bug#19737). +2015-02-11 Artur Malabarba + + * 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 * 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 c3a2061aae2..60cf65d2305 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. @@ -1929,7 +1929,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))))) @@ -2427,13 +2427,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 -- 2.11.4.GIT