From: Artur Malabarba Date: Sun, 12 Apr 2015 02:55:21 +0000 (+0100) Subject: * lisp/emacs-lisp/package.el: Improve `package-menu-refresh' X-Git-Tag: emacs-25.0.90~2478 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50ddc67739d14c4371e11ba52b91308efe21b3db;p=emacs.git * lisp/emacs-lisp/package.el: Improve `package-menu-refresh' (package-menu-refresh): Respect async and do new package checking. (list-packages): Use `package-menu-refresh' instead of repeating code. --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 745c5bf5dc4..ad482e564b0 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2589,8 +2589,9 @@ This fetches the contents of each archive specified in (interactive) (unless (derived-mode-p 'package-menu-mode) (user-error "The current buffer is not a Package Menu")) - (package-refresh-contents) - (package-menu--generate t t)) + (setq package-menu--old-archive-contents package-archive-contents) + (setq package-menu--new-package-list nil) + (package-refresh-contents package-menu-async)) (defun package-menu-describe-package (&optional button) "Describe the current package. @@ -2942,11 +2943,8 @@ The list is displayed in a buffer named `*Packages*'." (add-hook 'package--post-download-archives-hook #'package-menu--post-refresh) - (unless no-fetch - (setq package-menu--old-archive-contents package-archive-contents) - (setq package-menu--new-package-list nil) - ;; Fetch the remote list of packages. - (package-refresh-contents package-menu-async)) + ;; Fetch the remote list of packages. + (unless no-fetch (package-menu-refresh)) ;; Generate the Package Menu. (let ((buf (get-buffer-create "*Packages*")))