aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-05Unmention read-multiple-choice as an unimplemented functionPhilip Kaludercic
2022-08-05Add read-multiple-choice from Emacs 26Philip Kaludercic
2022-08-02Add take and ntake defined in Emacs 29Philip Kaludercic
2022-08-02Merge branch 'master' into emacs-29.1Philip Kaludercic
2022-07-29Drop MANUAL in favour of compat.texiPhilip Kaludercic
2022-07-29Exclude ~foo tests for file-name-absolute-pPhilip Kaludercic
As mentioned in NEWS.27: ** 'file-name-absolute-p' no longer considers "~foo" to be an absolute file name if there is no user named "foo".
2022-07-29Move compat--generate-verbose to compat-tests.elPhilip Kaludercic
2022-07-28Revert "Load compat-NM.el only if NM < emacs-major-version"Philip Kaludercic
This reverts commit fe923d8ef905dfdc1ca2a78147f5a7d28426d093.
2022-07-20Remove (elisp) manual prefix from linksPhilip Kaludercic
Texinfo adds these anyway, so there is no need to mention it in the link name.
2022-07-20Add file-name-absolute-p from Emacs 28Philip Kaludercic
2022-07-19Always load all compat files during testingPhilip Kaludercic
2022-07-19Make compat-font-lock dependency on compat-macs explicitPhilip Kaludercic
2022-07-19Load compat-NM.el only if NM < emacs-major-versionPhilip Kaludercic
As the default behaviour is just to load missing (unprefixed) definitions, which are all compiled away if NM ≤ emacs-major-version, there should be no functional difference. The advantage is that fewer files have to be opened, parsed and loaded. Suggested by Daniel Mendler in this thread: https://lists.sr.ht/~pkal/compat-devel/%3C87cze74icg.fsf_-_%40posteo.net%3E
2022-07-19Make compat.el not depend on compat-macs.elPhilip Kaludercic
2022-07-19Remove obsolete commentPhilip Kaludercic
2022-07-18Make compat-font-lock dependency on compat-macs explicitPhilip Kaludercic
2022-07-18Compile compat-macs before anything elsePhilip Kaludercic
2022-07-18Properly capitalise CentOS in READMEPhilip Kaludercic
2022-07-18Use compat-deftests for subr-primitive-p testsPhilip Kaludercic
2022-07-18Bump version to 28.1.2.028.1.2.0Philip Kaludercic
2022-07-17Merge branch 'simple-load'Philip Kaludercic
2022-07-17Add a declare-function for json-serializePhilip Kaludercic
2022-07-17Print version before starting testsPhilip Kaludercic
2022-07-17Do not modify load-suffixes during loadingPhilip Kaludercic
It appears that even this is too risky, and can cause issues recursive loading (from what I understand loading the non-byte compiled jka-compr.el causes this issue). Instead we will check if `compat-testing' is bound and true, in which case we explicitly load the .el file, and otherwise keep the file without a specific suffix.
2022-07-17Wrap provide calls in `compat--inhibit-prefixed'Philip Kaludercic
This is even simpler and less risky than copying `features' as it alleviates the risk of confusing the loading procedure.
2022-07-17Prepend ".el" to load-suffixes during testingPhilip Kaludercic
This is necessary to avoid loading potentially byte-compiled files using a generator function other than `compat--generate-verbose' (that is necessary for testing, to ensure all the necessary meta-data and a backup definition is provided).
2022-07-17Require sub-features instead of loading themPhilip Kaludercic
That way we can avoid loading a feature in case it has already been loaded previously (and would be contained in the copied value of `feature'), which should result in a marginal speed improvement.
2022-07-17Simplify subr-primitive-p definitionPhilip Kaludercic
Thanks to Stefan Monnier for the tip.
2022-07-17Respect compat-testing during loadingPhilip Kaludercic
2022-07-17Rename compat-deftest to compat-testsPhilip Kaludercic
2022-07-15Add subr-primitive-p defined in Emacs 28Philip Kaludercic
2022-07-14Simplify loading and compiling of CompatPhilip Kaludercic
To avoid the issue like having to find the source of the other files in the project during byte compilation, we will stop embedding (or "entwining") the compiled results of compat-*.el into compat.elc. While this may make loading slightly slower -- in my own tests it was unnoticeable -- it makes loading Compat a lot easier to manage and decreases the risk of running into peculiar edge cases, as documented here[0]. To accommodate for Compat's unusual approach, we still need to do something unusual, namely rebind the `features' variable, that is used by `require' to check if a feature is already bound or not. This is done so that while loading compat-NM.el, the bound version of `features' is updated but the updated version is reverted back as soon as the scope of the let-block is left. This allows `compat-NM' to be loaded again later on, without `compat--inhibit-prefixed' being bound, as is the case in compat.el. This variable, if bound, suppresses the evaluation of prefixed definitions, as had previously been done by the generator function `compat--generate-minimal-no-prefix'. Another marginal advantage of this approach is that if someone loads `compat-NM' before `compat' (for whatever reason), `compat-NM' will not be reloaded, as it is represented in both the actual as well as the copied value of `features'. [0] https://todo.sr.ht/~pkal/compat/4#event-180270
2022-07-11Revert "Simplify loading and compiling of Compat"Philip Kaludercic
This reverts commit 0c4af13dde7eb9980b636eae42954a9dfea31ba9.
2022-07-11Rebuild all files when compat-macs.el is changedPhilip Kaludercic
This could have been written in a single line, but that would have resulted in a long line in the long time.
2022-07-11Simplify loading and compiling of CompatPhilip Kaludercic
To avoid the issue like having to find the source of the other files in the project during byte compilation, we will stop embedding (or "entwining") the compiled results of compat-*.el into compat.elc. While this may make loading slightly slower -- in my own tests it was unnoticeable -- it makes loading Compat a lot easier to manage and decreases the risk of running into peculiar edge cases, as documented here[0]. To accommodate for Compat's unusual approach, we still need to do something unusual, namely rebind the `features' variable, that is used by `require' to check if a feature is already bound or not. This is done so that while loading compat-NM.el, the bound version of `features' is updated but the updated version is reverted back as soon as the scope of the let-block is left. This allows `compat-NM' to be loaded again later on, without `compat--inhibit-prefixed' being bound, as is the case in compat.el. This variable, if bound, suppresses the evaluation of prefixed definitions, as had previously been done by the generator function `compat--generate-minimal-no-prefix'. Another marginal advantage of this approach is that if someone loads `compat-NM' before `compat' (for whatever reason), `compat-NM' will not be reloaded, as it is represented in both the actual as well as the copied value of `features'. [0] https://todo.sr.ht/~pkal/compat/4#event-180270
2022-07-11Fix byte compiler issue related to compat-json-serializePhilip Kaludercic
2022-07-11Fix markup for fixed with text in manualPhilip Kaludercic
2022-07-11Add missing "@end defun" from 61d8e3953fPhilip Kaludercic
Thanks to Stefan Monnier for noticing
2022-07-10Add decoded-time-period defined in Emacs 28Philip Kaludercic
2022-06-24Avoid double-macroexpansion introduced in e5ec04fePhilip Kaludercic
This expanded the declare-function forms that in turn caused byte compilation issues if certain functions were not available, even if this was to be expected.
2022-06-24Fix format-prompt of an empty string as "default" argumentPhilip Kaludercic
2022-06-19Bump version to 28.1.1.328.1.1.3Philip Kaludercic
2022-06-17Eagerly expand macros in compat-entwinePhilip Kaludercic
In order for `compat--entwine-version' to be passed on to the macro generator functions, we cannot just bind the variable within the macro and forget about it. Generating a let binding instead of a `progn'-block is likewise insufficient, as this would only affect the evaluation, not the macro-expansion. It is therefore necessary to expand all macros (or at least all macros using `compat--generate-function', which for our intent is almost every case) while binding `compat--entwine-version', so that the binding is preserved. If this is not done, the version cannot be determined when loading compat.el (the main file). To my understanding this is not fatal, because all this affects is that compat.elc cannot be generated, so the slower compat.el has to be loaded.
2022-06-15Bump version to 28.1.1.128.1.1.2Philip Kaludercic
2022-06-06Apply change from faabc69ba8 to compat--entwine-versionPhilip Kaludercic
2022-06-05Disable (current-time) tests for time-equal-pPhilip Kaludercic
2022-06-05Fix using compat libraries uncompiledJonas Bernoulli
`compat-entwine' is called in two and only three distinct situations. 1. When "compat.el" is being loaded without having been compiled before. This can happen while a third-party library is being compiled, which requires `compat'. 2. When "compat.el" is being evaluated, such as when using `eval-buffer'. 3. When "compat.el" is being compiled. In all cases we need to detect where "compat.el" is located, because that also tells us where the "compat-XY.el" libraries are located and `compat-entwine' needs to read the contents of those files. To detect the location of "compat.el" we consult various variables, which we expect to either be nil or "/path/to/compat.el". We didn't use the correct variables. Some time ago Stefan added a call to `macro-file-name' to the front of that search, which fixes the search for Emacs 28.1. Older Emacs releases lack that function, so for those we still ended up consulting the wrong variables. To fix that use `current-load-list' directly, treating it the same way as `macro-file-name' does. If that gives us a non-nil value, then we are dealing with one of the first two cases and we are done. Otherwise we are dealing with the third case and `byte-compile-current-file' gives us the correct value. One of these sources is always non-nil, so drop the variables we used to fall back to. Then we pass the version from `compat-entwine' to the `compat--generate-function' function by binding the new variable `compat--entwine-version'. Previously this was done by binding `byte-compile-current-file`. The caller then had to extract the version from the name of that file. Binding `byte-compile-current-file` was also part of the bug that prevented compilation of a third-party library, which depends on "compat-XY.el", when compat's libraries have not been compiled yet. To fix that we have to change the order of the possible sources of the version string in `compat--generate-function' functions. As before we use the version explicitly specified for the function being processed, if any. Then we use value of the new `compat--entwine-version' variable, if that is bound and non-nil, i.e., if the binding from `compat-entwine' is in effect. Previously we would have tried `byte-compile-current-file' at this point instead, but while that might be non-nil because we used to bind it in `compat--generate-function', it could also be non-nil because an arbitrary third-party library is being compiled. That is a problem if that third-party library depends on "compat-XY.el" and the latter hasn't been compiled before: The `compat--generate-function' function is called directly in that case, without the binding from `compat-entwine' in effect. We need `byte-compile-current-file' to be some "compat-XY.el" library; not some arbitrary third-party library. Then we try `current-load-list' like in `compat-entwine', which here is some "compat-XY.el" library when some third-party library is being compiled and that requires that "compat-XY.el" library. Finally, if we could not determine a version any other way, then we know that some "compat-XY.el" library is being compiled. In that case, and only then, we can get the version string from `byte-compile-current-file'.
2022-06-05Add fix from faabc69ba to compat--generate-verbose tooJonas Bernoulli
2022-05-29Re-add void-function tests removed in ec82f43ef0Philip Kaludercic
2022-05-29Fix warnings about fancy quotesdr-scsi
* compat-26.el (func-arity, assoc): Silence the compiler about fancy quotes with Emacs 29.