docs: improve emacs version checks and their explanations

- Add a 27.x check, recommending that users upgrade to 28.1.
- Removed the check for <27. Loading doom.el with sub-27 will already
  fail with a detailed error about supported versions.
- Now detects development (.50) and pre-release (.9x) builds of Emacs,
  and warns the user of their dangers.
- Revises the warning for 29+ or .50|.9x users.
This commit is contained in:
Henrik Lissner 2022-09-12 18:46:02 +02:00
parent 07d22adb4a
commit a5bb50e957
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -52,28 +52,29 @@ in."
:benchmark nil :benchmark nil
(print! "The doctor will see you now...\n") (print! "The doctor will see you now...\n")
;; REVIEW Refactor me
(print! (start "Checking your Emacs version...")) (print! (start "Checking your Emacs version..."))
(print-group! (print-group!
(cond (cond ((or (> emacs-major-version 28)
((string= ".50" (substring emacs-version -3)) (string-match-p ".\\(50\\|9[0-9]\\)$" emacs-version))
(error! "Emacs development version detected (%s)" emacs-version) (warn! "Detected a development version of Emacs (%s)" emacs-version)
;; There are 2 newlines between each item to fight against (if (> emacs-major-version 28)
;; the (fill-region) call in `doom--output-autofill' (explain! "This is the bleeding edge of Emacs. Doom does not support it because Emacs "
(explain! "Doom supports this version, but you are using a development version of Emacs! " "HEAD is in an especially unstable period of its development. If you've found "
"Be prepared for possibly weekly breakages that\n" "a stable commit, great! But be cautious about updating too eagerly!\n")
"\t- you will have to investigate yourself." (explain! "A .50 or .9x appended to the version string indicates that this is a version of "
"\t- might appear, or be solved, on any Emacs update." "Emacs in between stable releases. These are not well supported.\n"))
"\t- might depend subtly on upstream packages updates.\n" (explain! "Because development builds are prone to random breakage, there will be a greater "
"You might need to unpin packages to get a fix for a specific commit of Emacs, " "burden on you to investigate and deal with issues. Please make extra sure that "
"and you should be ready to downgrade Emacs if something is just not fixable.")) "your issue is reproducible in 28.1 before reporting them to Doom's issue tracker!\n"
((> emacs-major-version 28) "\n"
(warn! "Emacs %s detected" emacs-version) "If this doesn't phase you, read the \"Why does Doom not support Emacs HEAD\" QnA "
(explain! "Doom supports this version, but you are living on the edge! " "in Doom's FAQ. It offers some advice for debugging and surviving issues on the "
"Be prepared for breakages in future versions of Emacs.")) "bleeding edge. Failing that, 28.1 is highly recommended and will always be "
((< emacs-major-version 27) "Doom's best supported version of Emacs."))
(error! "Emacs %s detected, Doom only supports 27.1 and newer" ((= emacs-major-version 27)
emacs-version)))) (warn! "Emacs 27 is supported, but consider upgrading to 28.1")
(explain! "Emacs 28.1 is better supported, faster, and more stable. Plus, Doom will drop "
"27.x support sometime mid-2022."))))
(print! (start "Checking for Doom's prerequisites...")) (print! (start "Checking for Doom's prerequisites..."))
(print-group! (print-group!