diff options
| author | Stefan Kangas | 2019-07-17 19:55:08 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2019-08-22 18:57:39 +0200 |
| commit | a6d87ea045d9df73f70765bedfb02522043efd9b (patch) | |
| tree | 060175b41936080e1fbc8da55aee1730bb48d576 | |
| parent | b289ceaf79dc9b284ed254854fc23106e1df0264 (diff) | |
| download | emacs-a6d87ea045d9df73f70765bedfb02522043efd9b.tar.gz emacs-a6d87ea045d9df73f70765bedfb02522043efd9b.zip | |
Signal user-error on duplicate package refresh
* lisp/emacs-lisp/package.el (package-menu-refresh): Signal a
user-error if there is already a refresh running in the
background. Doc fix. (Bug#36707)
| -rw-r--r-- | lisp/emacs-lisp/package.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a72522ad8f8..4e0c0464d48 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -3086,12 +3086,15 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." | |||
| 3086 | "`package-archive-contents' before the latest refresh.") | 3086 | "`package-archive-contents' before the latest refresh.") |
| 3087 | 3087 | ||
| 3088 | (defun package-menu-refresh () | 3088 | (defun package-menu-refresh () |
| 3089 | "Download the Emacs Lisp package archive. | 3089 | "In Package Menu, download the Emacs Lisp package archive. |
| 3090 | This fetches the contents of each archive specified in | 3090 | Fetch the contents of each archive specified in |
| 3091 | `package-archives', and then refreshes the package menu." | 3091 | `package-archives', and then refresh the package menu. Signal a |
| 3092 | user-error if there is already a refresh running asynchronously." | ||
| 3092 | (interactive) | 3093 | (interactive) |
| 3093 | (unless (derived-mode-p 'package-menu-mode) | 3094 | (unless (derived-mode-p 'package-menu-mode) |
| 3094 | (user-error "The current buffer is not a Package Menu")) | 3095 | (user-error "The current buffer is not a Package Menu")) |
| 3096 | (when (and package-menu-async package--downloads-in-progress) | ||
| 3097 | (user-error "Package refresh is already in progress, please wait...")) | ||
| 3095 | (setq package-menu--old-archive-contents package-archive-contents) | 3098 | (setq package-menu--old-archive-contents package-archive-contents) |
| 3096 | (setq package-menu--new-package-list nil) | 3099 | (setq package-menu--new-package-list nil) |
| 3097 | (package-refresh-contents package-menu-async)) | 3100 | (package-refresh-contents package-menu-async)) |