After this package was released, parinfer-mode was made, which vendored this package as this package isn't in a package archive. That package was eventually deprecated as the author started recommending parinfer-rust-mode instead.
As a long time user of Parinfer, I found the pure elisp version to be perfectly usable, with a few low-hanging fruit optimizations to be taken (it was needlessly running parinferlib-indent-mode twice when opening files, for example), so I've been focused on optimizing and improving my own fork of parinfer-mode instead of moving onto parinfer-rust-mode.
As part of this effort I also experimented with some changes to this library, eventually landing on the two main changes here: lexical binding and using global variables instead of passing a hash table around. These add up to a 50% improvement in performance (perf.el reports indent-mode going from 0.540383s to 0.278933s on my machine with the same number of GCs).
As this repository is not archived I figured I should probably upstream these changes.
performance
Use global variables instead of passing around a result hash table.
This is safe as state is always reset by parinferlib--create-initial-result (now renamed to parinferlib--initialize)
This brought perf.el's indent mode time from 0.51s down to 0.38s on my machine
Use lexical binding
This further brought perf.el's indent mode time from 0.38s down to 0.28s on my machine
tests
use a Makefile (this made it quicker for me to run tests with a task runner plugin)
After this package was released, parinfer-mode was made, which vendored this package as this package isn't in a package archive. That package was eventually deprecated as the author started recommending parinfer-rust-mode instead.
As a long time user of Parinfer, I found the pure elisp version to be perfectly usable, with a few low-hanging fruit optimizations to be taken (it was needlessly running parinferlib-indent-mode twice when opening files, for example), so I've been focused on optimizing and improving my own fork of parinfer-mode instead of moving onto parinfer-rust-mode.
As part of this effort I also experimented with some changes to this library, eventually landing on the two main changes here: lexical binding and using global variables instead of passing a hash table around. These add up to a 50% improvement in performance (perf.el reports indent-mode going from 0.540383s to 0.278933s on my machine with the same number of GCs).
As this repository is not archived I figured I should probably upstream these changes.
result
hash table.parinferlib--create-initial-result
(now renamed toparinferlib--initialize
)(when lst)
not(when (parinferlib--not-empty? lst))
as empty list = nilindent_size
option in editorconfig as that produces incorrect indentation for emacs lisp