refactor: do Emacs version check at compile time too

In case the user tries to byte-compile Doom with the wrong version of
Emacs.
This commit is contained in:
Henrik Lissner 2022-09-13 18:00:34 +02:00
parent 3a0f1aa3ef
commit 75881c7d45
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -49,9 +49,10 @@
;;
;;; Code:
;; Doom's minimum supported version of Emacs is 27.1. Its my goal to support one
;; major version below the stable release, for about a year or until stable is
;; ubiquitous (or at least easily accessible) across Linux distros.
(eval-and-compile ; Check version at both compile and runtime.
;; Doom's minimum supported version of Emacs is 27.1. Its my goal to support
;; one major version below the stable release, for about a year or until
;; stable is ubiquitous (or at least easily accessible) across Linux distros.
(when (< emacs-major-version 27)
(user-error
(concat
@ -73,7 +74,7 @@
(concat " $ EMACS=/path/to/valid/emacs " command " ...\n"
" $ EMACS=\"/Applications/Emacs.app/Contents/MacOS/Emacs\" " command " ...\n"
" $ EMACS=\"snap run emacs\" " command " ...\n"))
"\nAborting...")))))
"\nAborting..."))))))
;; Doom needs to be synced/rebuilt if either Doom or Emacs has been
;; up/downgraded. This is because byte-code isn't backwards compatible, and many