Skip to content

Apheleia 4.2

Compare
Choose a tag to compare
@raxod502 raxod502 released this 03 Aug 23:23
· 17 commits to main since this release

Changes

  • Custom Emacs Lisp formatting functions have the option to report an error asynchronously by invoking their callback with an error as argument. Passing nil as argument indicates that there was no error, as before. The old calling convention is still supported for backwards compatibility, and errors can also be reported by throwing, as normal. Implemented in #204.

Features

  • New user option apheleia-mode-predicates. The default value handles mhtml-mode correctly by always using whatever formatter you have configured for that mode, rather than using css-mode, html-mode, etc formatters depending on the position of point (#302).

Enhancements

  • There is a new keyword argument to apheleia-format-buffer which is a more powerful callback that is guaranteed to be called except in cases of synchronous nonlocal exit. See the docstring for details. The old callback, which is only invoked on success and receives no information about errors, is still supported and will continue to be called if provided. See #204.

Formatters

Bugs fixed

  • The point alignment algorithm, which has been slightly wrong since 2019, has been fixed to more correctly use dynamic programming to maintain the position of point. Also, some cases of a nil pointer error during point alignment have been fixed (#290).
  • apheleia-indent-lisp-buffer updated to apply local variables after calling major-mode. Also includes setting for indent-tabs-mode (#286).
  • Formatter scripts will now work on Windows if Emacs can find the executable defined in the shebang.

Internal

  • Major internal refactoring has occurred to make it possible to write integration tests against Apheleia. This should improve future stability but could have introduced some bugs in the initial version. See #204.
  • Some debugging log messages have changed, see #204.