diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-03-31 10:33:23 +0100 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-03-31 10:33:23 +0100 |
commit | e9af469c65aae102ebe0b13ca089b388c746d455 (patch) | |
tree | 219a3e0161af0b5e1b4cb19df2663674d954a84c | |
parent | 69ec6aee823e87091dc9c171022025e644458c0b (diff) | |
download | emacs-scratch/package.el-async-refresh.tar.gz |
Simplify find-and-notify upgrades.scratch/package.el-async-refresh
-rw-r--r-- | lisp/emacs-lisp/package.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b682beda595..490fb45a98f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2764,13 +2764,12 @@ Store this list in `package-menu--new-package-list'." (defun package-menu--find-and-notify-upgrades () "Notify the user of upgradeable packages." - (let ((upgrades (package-menu--find-upgrades))) - (if upgrades - (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading." - (length upgrades) - (if (= (length upgrades) 1) "" "s") - (substitute-command-keys "\\[package-menu-mark-upgrades]") - (if (= (length upgrades) 1) "it" "them"))))) + (when-let ((upgrades (package-menu--find-upgrades))) + (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading." + (length upgrades) + (if (= (length upgrades) 1) "" "s") + (substitute-command-keys "\\[package-menu-mark-upgrades]") + (if (= (length upgrades) 1) "it" "them")))) (defun package-menu--post-refresh () "Function to be called after `package-refresh-contents' is done. |