#+title: Compat News
#+link: compat-gh https://github.com/emacs-compat/compat/issues/

* Version 31.0.0.2 (2026-07-09)

- compat-31: Fix extended function =seconds-to-string=.

* Version 31.0.0.1 (2026-05-03)

- compat-31: Improve =with-work-buffer= implementation.

* Version 31.0.0.0 (2026-05-01)

- compat-28: New pcase pattern =cl-type=.
- compat-29: Add =string-glyph-compose= and =string-glyph-decompose=.
- compat-31: New macros =static-when= and =static-unless=.
- compat-31: New functions =oddp= and =evenp=.
- compat-31: New functions =minusp= and =plusp=.
- compat-31: New macros =incf= and =decf=.
- compat-31: New function =color-blend=.
- compat-31: New function =completion-table-with-metadata=.
- compat-31: New function =completion-list-candidate-at-point=.
- compat-31: New macro =with-work-buffer=.
- compat-31: New function =unbuttonize-region=.
- compat-31: New extended function =seconds-to-string=.
- compat-31: New function =hash-table-contains-p=.
- compat-31: New function =remove-display-text-property=.
- compat-31: New functions =drop-while=, =take-while=, =member-if=, =any=, =all=.
- compat-31: New function =set-local=.
- compat-31: New function =ensure-proper-list=.
- compat-31: New error API functions =error-type-p=, =error-has-type-p=, =error-type=
  and =error-slot-value=.
- Drop support for Emacs 24.x. Emacs 25.1 is required now. In case
  Emacs 24.x support is still needed, Compat 30 can be used.

* Version 30.1.0.1 (2025-06-19)

- compat-28: Fix =named-let= tail recursion.

* Version 30.1.0.0 (2025-04-02)

- compat-30: Add oklab color functions.

* Version 30.0.2.0 (2025-01-04)

- compat-30: Rename =trusted-files= to =trusted-content=.

* Version 30.0.1.0 (2024-12-15)

- compat-30: New variable =untrusted-content=.
- compat-30: New variable =trusted-files=.
- compat-30: New function =trusted-content-p=.

* Version 30.0.0.0 (2024-07-08)

- compat-28: Mark =subr-native-elisp-p= as obsolete (renamed in Emacs 30).
- compat-30: New function =char-to-name=.
- compat-30: New function =obarray-clear=.
- compat-30: New function =interpreted-function-p=.
- compat-30: New function =primitive-function-p=.
- compat-30: New function =closurep=.
- compat-30: Add extended function =sort= with keyword arguments.
- compat-30: New function =value<=.
- compat-30: Add extended =copy-tree= with support for copying records with
  non-nil optional second argument.
- compat-30: New macro =static-if=.
- compat-30: New alias =drop=.
- compat-30: New function =merge-ordered-lists=.
- compat-30: New variables =completion-lazy-hilit= and =completion-lazy-hilit-fn=
  and new function =completion-lazy-hilit=.
- compat-30: New function =require-with-check=.
- compat-30: New functions =find-buffer= and =get-truename-buffer=.
- compat-30: Add extended =completion-metadata-get= with support for
  =completion-category-overrides= and =completion-extra-properties=.

* Version 29.1.4.5 (2024-03-16)

- Minor optimization of ~plist-get~ and ~plist-put~.
- Minor compatibility adjustments for the Emacs 30 development version.
- A minimal version of =compat.el= will be part of Emacs 30. Emacs :core packages
  can directly ~(require 'compat)~ without the ~NOERROR~ flag. Furthermore Compat
  will not be installed unnecessarily. If a package depending on Emacs 25.1 and
  Compat 29.1 is installed on Emacs 30.1, Compat 29.1 will not be installed from
  ELPA, since Emacs 30.1 already provides the required functionality.

* Version 29.1.4.4 (2023-11-13)

- Fix ~Package-Requires~ header in compat.el
- Fix ~Maintainer~ header in compat.el

* Version 29.1.4.3 (2023-11-04)

- compat-29: Add function =char-uppercase-p=.
- compat-29: Add function =window-configuration-equal-p=.

* Version 29.1.4.2 (2023-07-30)

- compat-28: Improve =make-separator-line= visuals on graphic displays.
- compat-28: Add =native-comp-available-p=, which always returns nil.
- compat-29: Add variable =lisp-directory=.

* Version 29.1.4.1 (2023-03-26)

- compat-29: Add ~directory-abbrev-apply~.
- compat-29: Add ~directory-abbrev-make-regexp~.

* Version 29.1.4.0 (2023-03-05)

- compat-27: Drop obsolete ~compat-call dired-get-marked-files~.
- compat-28: Add support for ~defcustom~ type ~natnum~.
- compat-29: Add ~with-restriction~ and ~without-restriction~.
- compat-29: Add ~cl-constantly~.
- compat-29: Drop ~with-narrowing~ which was renamed to ~with-restriction~.
- compat-28: Add support for ~defcustom~ type ~key~.

* Version 29.1.3.4 (2023-02-11)

- Ensure that ~seq~ is required properly both at compile time and runtime, such
  that compilation of downstream packages works even if Compat itself is not
  compiled. Magit uses a complex continuous integration system, where Magit is
  compiled and tested, while the Compat dependency is not compiled.
- compat-28: Add ~process-lines-handling-status~ and ~process-lines-ignore-status~.

* Version 29.1.3.3 (2023-02-08)

- compat-27: Add ~with-suppressed-warnings~.
- compat-29: Add ~cl-with-gensyms~ and ~cl-once-only~.
- compat-29: Load ~seq~, which is preloaded on Emacs 29.

* Version 29.1.3.2 (2023-02-01)

- compat-26: Add ~make-temp-file~ with optional argument TEXT.
- compat-27: Mark ~compat-call dired-get-marked-files~ as obsolete. See the
  section limitations in the Compat manual.
- compat-29: Add ~funcall-with-delayed-message~ and ~with-delayed-message~.
- compat-29: Add ~ert-with-temp-file~ and ~ert-with-temp-directory~.
- compat-29: Add ~set-transient-map~ with optional arguments MESSAGE and TIMEOUT.

* Version 29.1.3.1 (2023-01-25)

- Fix regression, which prevented loading Compat in interpreted mode. We ensure
  that Compat works interpreted and byte compiled by running the entire test
  suite twice in the CI. See https://github.com/magit/magit/issues/4858 for the
  corresponding Magit issue.
- compat-27: Add ~file-name-unquote~.
- compat-28: Add ~mark-thing-at-mouse~.
- compat-29: Replace ~string-lines~ with version from Emacs 29, support optional
  KEEP-NEWLINES argument.

* Version 29.1.3.0 (2023-01-22)

- compat-25: Add ~hash-table-empty-p~.
- compat-25: Add ~macroexp-parse-body~ and ~macroexp-quote~.
- compat-25: Add ~region-noncontiguous-p~.
- compat-25: Add ~save-mark-and-excursion~.
- compat-26: Add ~read-answer~.
- compat-26: Add ~region-bounds~.
- compat-27: Add ~date-ordinal-to-time~.
- compat-27: Add ~file-size-human-readable-iec~.
- compat-27: Add ~major-mode-suspend~ and ~major-mode-restore~.
- compat-27: Add ~make-decoded-time~.
- compat-27: Add ~minibuffer-history-value~.
- compat-27: Add ~read-char-from-minibuffer~.
- compat-27: Add ~ring-resize~.
- compat-28: Add ~color-dark-p~.
- compat-28: Add ~directory-files-and-attributes~ with COUNT argument.
- compat-28: Add ~text-quoting-style~.
- compat-28: Add ~with-window-non-dedicated~.
- compat-29: Add ~buffer-local-set-state~ and ~buffer-local-restore-state~.
- compat-29: Add ~compiled-function-p~.
- compat-29: Add ~count-sentences~.
- compat-29: Add ~delete-line~.
- compat-29: Add ~get-scratch-buffer-create~.
- compat-29: Add ~list-of-strings-p~.
- compat-29: Add ~plist-get~ generalized variable.
- compat-29: Add ~plistp~.
- compat-29: Add ~read-multiple-choice~ with LONG-FORM argument.
- compat-29: Add ~readablep~.
- compat-29: Add ~substitute-quotes~.
- compat-29: Add ~use-region-beginning~, ~use-region-end~ and ~use-region-noncontiguous-p~.
- compat-29: Add ~with-narrowing~.

* Version 29.1.2.0 (2023-01-16)

- All compatibility functions are covered by tests!
- Add links from compatibility definitions to tests.
- BREAKING: Drop JSON parsing support (libjansson API, unused downstream).
- BREAKING: Drop ~null-device~ (unused downstream).
- BREAKING: Drop ~unlock-buffer~ (unused downstream).
- compat-26: Add ~buffer-hash~.
- compat-27: Add ~fixnump~ and ~bignump~.
- compat-27: Add ~with-minibuffer-selected-window~.
- compat-27: Add generalized variables for ~decoded-time-*~.
- compat-28: Add ~macroexp-warn-and-return~.
- compat-28: Add ~subr-native-elisp-p~.
- compat-28: Add ~bounds-of-thing-at-mouse~.
- compat-29: Add ~with-buffer-unmodified-if-unchanged~.
- compat-29: Fix and test ~define-key~ with REMOVE argument.

* Version 29.1.1.1 (2023-01-14)

- Add tests, 167 out of 203 definitions tested (82%).
- compat-25: Improve algorithmic complexity of ~sort~.
- compat-28: Add ~make-separator-line~.
- compat-29: Minor fixes to ~keymap-*~ functions.
- compat-29: Add ~with-memoization~.
- compat-29: Add ~buttonize~ and ~buttonize-region~.

* Version 29.1.1.0 (2023-01-07)

- The macros in ~compat-macs.el~ have been rewritten and simplified. The
  refactoring allows to further refine the criteria under which compatibility
  aliases, functions, macros and variables are installed.
- Remove deprecated, prefixed compatibility functions.
- Remove deprecated features ~compat-help~, ~compat-font-lock~ and ~compat-24~.
- Compat uses runtime checks (~boundp~, ~fboundp~) to ensure that existing
  definitions are never overridden, when Compat is loaded on a newer Emacs than
  it was compiled on.
- Compat compiles without byte compilation warnings on all supported Emacs
  versions. Warnings are treated as errors in the test suite.
- Compat takes great care to remove unneeded definitions at compile time. On
  recent Emacs 29 the byte compiled files are empty and not loaded, such that
  Compat does not any cost to the Emacs process.
- compat-26: Fix and test ~image-property~ setter.
- compat-26: Fix and test ~read-multiple-choice~.
- compat-28: Fix and test ~with-existing-directory~.
- compat-28: Drop obsolete function ~make-directory-autoloads~.
- compat-29: Drop broken functions ~string-pixel-width~ and
  ~buffer-text-pixel-size~. These functions had poor performance which lead to a
  downstream issue in the doom-modeline package. If a more efficient solution is
  possible, the function will be added back. See [[compat-gh:8]] for the bug report.
- compat-29: Drop broken function ~string-limit~.
- compat-29: Drop broken macro ~with-buffer-unmodified-if-unchanged~, which relied
  on ~buffer-hash~ which does not exist on all supported Emacs versions.
- compat-29: Add ~pos-bol~ and ~pos-eol~.

* Version 29.1.0.1 (2023-01-05)

- Add multiple new tests for existing APIs.
- Fix bugs in compatibility functions: ~setq-local~, ~proper-list-p, prop-match-p~,
  ~file-name-concat~, ~replace-regexp-in-region~, ~replace-string-in-region~.
- Add new Emacs 29 APIs. Some of them are still untested and may change. If you
  intend to use an Emacs 29 API please be careful and if possible contribute
  test cases. All untested functions are marked in the Compat code. Over time
  tests for all functions will be added gradually.
- Add the macros ~compat-call~ and ~compat-function~ to call compatibility
  functions. Since Compat avoids overwriting already existing functions, we must
  define separate compatibility function definitions for functions which changed
  their calling convention or behavior. These compatibility definitions can be
  looked up using ~compat-function~ and called with ~compat-call~. For example ~assoc~
  can be called with a ~TESTFN~ since Emacs 26. In Emacs 25 and older the calling
  convention was ~(assoc KEY ALIST)~. In order to use the new calling convention
  you can use ~(compat-call assoc KEY ALIST TESTFN)~.
- Deprecate all ~compat-*~ prefixed functions. Instead use the aforementioned
  ~compat-call~ or ~compat-function~ macros.
- Deprecate ~compat-help.el~ and ~compat-font-lock.el.~
- Development moved to GitHub.
- BREAKING: Drop broken function ~func-arity~. Using ~func-arity~ is generally
  discouraged and the function is hard to implement properly due to all the
  various function types. There it is unlikely that the function will get
  reintroduced in Compat.
- BREAKING: Drop broken function ~directory-files-recursively~. In case you need
  this function, a patch including tests is welcome.
- BREAKING: Drop support for Emacs 24.3. Emacs 24.4 is required now. In case you
  still need Emacs 24.3 support, you can rely on Compat 28.1.2.2.

* Version 28.1.2.2 (2022-08-25)

This is a minor release.

* Version 28.1.2.1 (2022-08-24)

This is a minor release adding the following changes:

- Add =derived-mode-p= defined in Emacs 27
- Add =provided-mode-derived-p= defined in Emacs 27
- Add =read-multiple-choice= defined in Emacs 26
- Add =file-name-absolute-p= defined in Emacs 28

The only other notable change is that the manual has been rewritten to
include much more documentation that had been the case previously.

* Version 28.1.2.0 (2022-07-18)

The main change of this release has been the major simplification of
Compat's initialisation system, improving the situation around issues
people had been reporting with unconventional or unpopular packaging
systems.

In addition to this, the following functional changes have been made:

- Fix =format-prompt= of an empty string as "default" argument
- Add =decoded-time-period= defined in Emacs 28
- Add =subr-primitive-p= defined in Emacs 28

Minor improvements to manual are also part of this release.

* Version 28.1.1.3 (2022-06-19)

This release just contains a hot-fix for an issue introduced in the
last version, where compat.el raises an error during byte compilation.

* Version 28.1.1.2 (2022-06-22)

Two main changes have necessitated a new patch release:

1. Fix issues related to the loading of compat when uncompiled.
2. Fix issues related to the loading of compat on old pre-releases
   (think of 28.0.50).

* Version 28.1.1.1 (2022-05-05)

This is a minor release fixing a bug in =json-serialize=, that could
cause unintended side-effects, not related to packages using Compat
directly.

* Version 28.1.1.0 (2022-04-22)

This release mostly fixes a number of smaller bugs that were not
identified as of 28.1.0.0.  Nevertheless these warrant a version bump,
as some of these changes a functional.  These include:

- The addition of the =file-attribute-*= accessor functions.
- The addition of =file-attribute-collect=.
- Improvements to the Texinfo manual (via Jonas Bernoulli's recent
  work on =ox-texinfo=).  For the time being, the Texinfo file is
  maintained in the repository itself, next to the =MANUAL= file.
  This might change in the future.
- Adding a prefix to =string-trim=, =string-trim-left= and
  =string-trim-right= (i.e. now =compat-string-trim=,
  =compat-string-trim-left= and =compat-string-trim-right=)
- Improving the version inference used in the =compat-*= macros.
  This improves the compile-time optimisation that strips away
  functions that are known to be defined for a specific version.
- The addition of generalised variable (=setf=) support for
  =compat-alist-get=.
- The addition of =image-property= and generalised variable support
  for =image-property=.
- The addition of the function =compat-executable-find=.
- The addition of the function =compat-dired-get-marked-files=.
- The addition of the function =exec-path=.
- The addition of the function =make-lock-file-name=.
- The addition of the function =null-device=.
- The addition of the function =time-equal-p=.
- The addition of the function =date-days-in-month=.
- Handling out-of-directory byte compilation better.
- Fixing the usage and edge-cases of =and-let*=.
