summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/package.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r--lisp/emacs-lisp/package.el28
1 files changed, 13 insertions, 15 deletions
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