diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-02-10 13:35:03 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-02-10 13:35:03 +0100 |
| commit | 15d19d0e01768189d94b585f150a430df248b410 (patch) | |
| tree | d378c936154bb7677c5f0a7a4f058cfc9de6b491 | |
| parent | a32f526c35ec2f73970f35fc424e6a452b3df250 (diff) | |
Manual: More documentation about using Compat in Emacs core
| -rw-r--r-- | compat.texi | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/compat.texi b/compat.texi index 460e8c1..b3fd598 100644 --- a/compat.texi +++ b/compat.texi @@ -119,12 +119,11 @@ In any file where compatibility forms are used, a (require 'compat) @end example -should be added early on. In packages which are part of Emacs itself, -the noerror flag should be specified. - -@example -(require 'compat nil 'noerror) -@end example +should be added early on. In packages which are part of Emacs itself +and which want to take advantage of Compat, the @code{noerror} flag +should be specified: @code{(require 'compat nil 'noerror)}. In the +future a minimal version of Compat may be added to the Emacs core, +such that the @code{noerror} flag will not be necessary anymore. This will load all necessary Compat definitions. Compat also loads the @code{seq} library which is preloaded by default on Emacs 29. @@ -161,6 +160,15 @@ See @code{compat-call} for a more convenient macro to directly call compatibility functions. @end defmac +If Compat is used in core packages, where Compat must be required +currently with the @code{noerror} flag, the macros @code{compat-call} +and @code{compat-function} ar not available. In the future the macros +could be added to subr. Alternatively a minimal version of compat.el +could be added to the core. For now it is necessary to replicate the +definition of the macros within core packages. For example the +package ERC defines its own macro @code{erc-compat-call}, which +replicates the Compat definition precisely. + This design has been chosen since Compat does not advise or override existing functions. Generally Compat is written in defensive style which is supposed to reduce potential breakage, and to increase the |
