branch: elpa/git-commit
commit 041f034c6d4974ff4370fc67a0eea9970665b3bc
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Inform users if they have to manually upgrade transient
---
lisp/magit-mode.el | 7 +++++++
lisp/magit-section.el | 26 ++++++++++++++------------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 060ece303e..08c5f84a89 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -33,7 +33,14 @@
(require 'format-spec)
(require 'help-mode)
+
(require 'transient)
+(unless (fboundp 'transient-prefix-object)
+ (display-warning 'magit (substitute-command-keys
+ (format magit--core-upgrade-instructions
+ 'transient "0.5.0" 'transient
+ 'transient 'transient 'transient))
+ :emergency))
(defvar bookmark-make-record-function)
(defvar magit--wip-inhibit-autosave)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 4b562b65ce..f02a55435e 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -56,11 +56,11 @@
(unload-feature 'seq 'force))
(require 'seq)
;; Furthermore, by default `package' just silently refuses to upgrade.
-(unless (fboundp 'seq-keep)
- (display-warning 'magit (substitute-command-keys "\
-Magit requires `seq' >= 2.24, but due to
-bad defaults, Emacs' package manager, refuses to upgrade this
-and other built-in packages to higher releases from GNU Elpa.
+(defconst magit--core-upgrade-instructions "\
+Magit requires `%s' >= %s,
+but due to bad defaults, Emacs' package manager, refuses to
+upgrade this and other built-in packages to higher releases
+from GNU Elpa.
To fix this, you have to add this to your init file:
@@ -69,21 +69,23 @@ To fix this, you have to add this to your init file:
Then evaluate that expression by placing the cursor after it
and typing \\[eval-last-sexp].
-Once you have done that, you have to explicitly upgrade `seq':
+Once you have done that, you have to explicitly upgrade `%s':
- \\[package-upgrade] seq \\`RET'
+ \\[package-upgrade] %s \\`RET'
Then you also must make sure the updated version is loaded,
by evaluating this form:
- (progn (unload-feature 'seq t) (require 'seq))
-
-Until you do this, you will get random errors about `seq-keep'
-being undefined while using Magit.
+ (progn (unload-feature '%s t) (require '%s))
If you don't use the `package' package manager but still get
this warning, then your chosen package manager likely has a
-similar defect.") :emergency))
+similar defect.")
+(unless (fboundp 'seq-keep)
+ (display-warning 'magit (substitute-command-keys
+ (format magit--core-upgrade-instructions
+ 'seq "2.24" 'seq 'seq 'seq 'seq))
+ :emergency))
(require 'cursor-sensor)
(require 'format-spec)