diff options
| author | Erik Martin-Dorel | 2021-02-25 17:39:28 +0100 |
|---|---|---|
| committer | Erik Martin-Dorel | 2021-02-25 17:39:28 +0100 |
| commit | b407bca53231c000bf5a71812d517924d4f05940 (patch) | |
| tree | 1911f731f4d10bcfb0cddfed36f67f6162ce0f28 /generic/proof-utils.el | |
| parent | bdb67820696b2bfec06fda72f2a39548c73dcaf7 (diff) | |
feat: Add proof-upgrade-menu triggering proof-upgrade-elpa-packages
* require package.el (in a safe way thanks to `proof-try-require`)
Diffstat (limited to 'generic/proof-utils.el')
| -rw-r--r-- | generic/proof-utils.el | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 39d1c22a..c5f4960d 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -5,7 +5,7 @@ ;; Portions © Copyright 1994-2012 David Aspinall and University of Edinburgh ;; Portions © Copyright 2003-2018 Free Software Foundation, Inc. ;; Portions © Copyright 2001-2017 Pierre Courtieu -;; Portions © Copyright 2010, 2016 Erik Martin-Dorel +;; Portions © Copyright 2010, 2016, 2021 Erik Martin-Dorel ;; Portions © Copyright 2011-2013, 2016-2017 Hendrik Tews ;; Portions © Copyright 2015-2017 Clément Pit-Claudel @@ -101,6 +101,28 @@ Return nil if not a script buffer or if no active scripting buffer." (file-error nil)) (featurep symbol)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Facility to upgrade all ELPA packages (including ProofGeneral) +;; + + +(defun proof-upgrade-elpa-packages () + "Upgrade all ELPA packages (using package.el)." + (interactive) + (unless (proof-try-require 'package) + (error "The package feature is not available!")) + (let ((old-async package-menu-async)) + (setq package-menu-async nil) + (package-list-packages) + (package-menu-mark-upgrades) + (let ((use-dialog-box nil)) + ;; make `y-or-n-p' show up within the minibuffer + ;; even if `proof-upgrade-elpa-packages' is called interactively + ;; to avoid any dialog-box overflow if many packages are updated + (package-menu-execute)) + (setq package-menu-async old-async))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; |
