From 50ddc67739d14c4371e11ba52b91308efe21b3db Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 12 Apr 2015 03:55:21 +0100 Subject: [PATCH] * 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. --- lisp/emacs-lisp/package.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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*"))) -- 2.39.2