aboutsummaryrefslogtreecommitdiff
path: root/compat-macs.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-03 01:36:13 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-03 15:50:27 +0100
commitd4624d9aed1eaf3f91108c16b661ad2902100e28 (patch)
tree720d6678c9010cf23939adc4ee4aad1d40e5560c /compat-macs.el
parent84635968be8cf6641af706ac15d57c227f0a3d76 (diff)
Always load prefixed definitions
We will move away from prefixed definitions later on and introduce `compat-function' and `compat-funcall' macros. These macros make it possible to call compatibility functions with different calling conventions. The prefixed definitions will be deprecated. The problem with the prefixed definitions is two-fold: 1. They pollute the namespace and the API surface of Compat will become larger and larger with every version. 2. Since Compat is not part of Emacs itself, the prefixed definitions cannot be used by :core packages. By adding the `compat-funcall' and `compat-function' macro to the core itself, which is a minimal addition, using compatibility function with modified calling convention becomes possible.
Diffstat (limited to 'compat-macs.el')
-rw-r--r--compat-macs.el13
1 files changed, 1 insertions, 12 deletions
diff --git a/compat-macs.el b/compat-macs.el
index 75a2e9a..e0220dd 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -29,17 +29,6 @@
"Ignore all arguments."
nil)
-(defvar compat--inhibit-prefixed nil
- "Non-nil means that prefixed definitions are not loaded.
-A prefixed function is something like `compat-assoc', that is
-only made visible when the respective compatibility version file
-is loaded (in this case `compat-26').")
-
-(defmacro compat--inhibit-prefixed (&rest body)
- "Ignore BODY unless `compat--inhibit-prefixed' is true."
- `(unless (bound-and-true-p compat--inhibit-prefixed)
- ,@body))
-
(defvar compat-current-version nil
"Default version to use when no explicit version was given.")
@@ -114,7 +103,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
(version< max-version emacs-version)))
'(compat--ignore))
((plist-get attr :prefix)
- '(compat--inhibit-prefixed))
+ '(progn))
((and version (version<= version emacs-version) (not cond))
'(compat--ignore))
(`(when (and ,(if cond cond t)