* emacs-lisp/package.el (package-selected-packages): Fix :type
(package-install): Rename ARG to MARK-SELECTED.
(package--get-deps): Fix for indirect dependencies.
+ (package-used-elsewhere-p): Rename to
+ (package--used-elsewhere-p): New function.
+ (package-reinstall, package-user-selected-packages-install)
+ (package-autoremove): Use sharp-quote.
+ (package-user-selected-packages-install): Reindent and rename to
+ (package-install-user-selected-packages): New function.
2015-02-01 Thierry Volpiatto <thierry.volpiatto@gmail.com>
"Reinstall package PKG."
(interactive (list (intern (completing-read
"Reinstall package: "
- (mapcar 'symbol-name
- (mapcar 'car package-alist))))))
+ (mapcar #'symbol-name
+ (mapcar #'car package-alist))))))
(package-delete (cadr (assq pkg package-alist)) t)
(package-install pkg))
(t (append direct-deps indirect-deps)))))
;;;###autoload
-(defun package-user-selected-packages-install ()
+(defun package-install-user-selected-packages ()
"Ensure packages in `package-selected-packages' are installed.
If some packages are not installed propose to install them."
(interactive)
(when (y-or-n-p
(format "%s packages will be installed:\n%s, proceed?"
(length lst)
- (mapconcat 'symbol-name lst ", ")))
- (mapc 'package-install lst))
- (message "All your packages are already installed"))))
+ (mapconcat #'symbol-name lst ", ")))
+ (mapc #'package-install lst))
+ (message "All your packages are already installed"))))
-(defun package-used-elsewhere-p (pkg-desc &optional pkg-list)
- "Check in PKG-LIST if PKG-DESC is used elsewhere as dependency.
+(defun package--used-elsewhere-p (pkg-desc &optional pkg-list)
+ "Non-nil if PKG-DESC is a dependency of a package in PKG-LIST.
+Return the first package found in PKG-LIST of which PKG is a
+dependency.
-When not specified, PKG-LIST default to `package-alist'
-with PKG-DESC entry removed.
-Returns the first package found in PKG-LIST where PKG is used as dependency."
+When not specified, PKG-LIST defaults to `package-alist'
+with PKG-DESC entry removed."
(unless (string= (package-desc-status pkg-desc) "obsolete")
(let ((pkg (package-desc-name pkg-desc)))
(cl-loop with alist = (or pkg-list
(remove (assq pkg package-alist)
package-alist))
for p in alist thereis
- (and (memq pkg (mapcar 'car (package-desc-reqs (cadr p))))
+ (and (memq pkg (mapcar #'car (package-desc-reqs (cadr p))))
(car p))))))
(defun package-delete (pkg-desc &optional force)
(package-desc-full-name pkg-desc)))
((and (null force)
(setq pkg-used-elsewhere-by
- (package-used-elsewhere-p pkg-desc)))
+ (package--used-elsewhere-p pkg-desc)))
;; Don't delete packages used as dependency elsewhere.
(error "Package `%s' is used by `%s' as dependency, not deleting"
(package-desc-full-name pkg-desc)
append (package--get-deps p) into lst
else do (push p old-direct)
finally return lst)))
- (cl-loop for p in (mapcar 'car package-alist)
+ (cl-loop for p in (mapcar #'car package-alist)
unless (or (memq p needed)
(memq p package-selected-packages))
collect p into lst
finally (if lst
(when (y-or-n-p (format "%s packages will be deleted:\n%s, proceed? "
(length lst)
- (mapconcat 'symbol-name lst ", ")))
+ (mapconcat #'symbol-name lst ", ")))
(mapc (lambda (p)
(package-delete (cadr (assq p package-alist)) t))
lst))