aboutsummaryrefslogtreecommitdiff
path: root/compat-macs.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-06 01:20:31 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-06 10:35:53 +0100
commit34463680d51316441c54920e90e7ac010c18b50e (patch)
treef837aad5233c7c2921f80f440aded2e675f1353c /compat-macs.el
parent9fe496cee177e82c983c5fa1643125da00638426 (diff)
Add runtime version check
We must make sure that we don't load Compat in an incompatible Emacs version.
Diffstat (limited to 'compat-macs.el')
-rw-r--r--compat-macs.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/compat-macs.el b/compat-macs.el
index 4c9eda4..0d9a8b4 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -31,7 +31,9 @@
(defmacro compat-declare-version (version)
"Set the Emacs version that is currently being handled to VERSION."
(setq compat--current-version version)
- nil)
+ `(unless (equal emacs-version ,emacs-version)
+ (error ,(format "Compat was compiled with Emacs %s, you are running %%s" emacs-version)
+ emacs-version)))
(defun compat--format-docstring (type name docstring)
"Format DOCSTRING for NAME of TYPE.