diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-03 01:36:13 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-01-03 15:50:27 +0100 |
| commit | d4624d9aed1eaf3f91108c16b661ad2902100e28 (patch) | |
| tree | 720d6678c9010cf23939adc4ee4aad1d40e5560c /compat.el | |
| parent | 84635968be8cf6641af706ac15d57c227f0a3d76 (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.el')
| -rw-r--r-- | compat.el | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -40,17 +40,12 @@ ;;; Code: -(defvar compat--inhibit-prefixed) -(let ((compat--inhibit-prefixed (not (bound-and-true-p compat-testing)))) - ;; Instead of using `require', we manually check `features' and call - ;; `load' to avoid the issue of not using `provide' at the end of - ;; the file (which is disabled by `compat--inhibit-prefixed', so - ;; that the file can be loaded again at some later point when the - ;; prefixed definitions are needed). - (dolist (version '(24 25 26 27 28 29)) - (let ((feature-name (format "compat-%d" version))) - (unless (memq (intern feature-name) features) - (load feature-name nil t))))) +(require 'compat-24) +(require 'compat-25) +(require 'compat-26) +(require 'compat-27) +(require 'compat-28) +(require 'compat-29) (provide 'compat) ;;; compat.el ends here |
