* using add-hook to modify company-backends is bad juju
* there does not appear to be a sensible way for a mode to
modify company-backends either in the variable docstring or the
online documentation here
https://company-mode.github.io/manual/Backends.html
so... we should not modify it.
* document the added effort to use the company backend
* the only additional fanciness to `systemd-company-backend' is that
it will automatically insert an = after completing a directive, so
it might be nice to work that into the capf completion somehow and
trash the company-specific code
The systemd.unit(5) manpage sorts unit file specifiers alphabetically
since commit systemd/systemd@709f4c472c, and since the order in this
regular expression is even less relevant than in the manpage, let’s just
do the same to make it easy to compare the letter sets between the two.
between font-lock-keywords, the elisp manual, examples in the emacs
source (sh-mode is one) and the webernets, it is rather difficult to
find a way to properly deal with multi-line construct syntax
highlighting. this is a way leveraging anchored matching and
jit-lock.
more importantly, bind systemd-font-lock-keywords to a _symbol_.
this makes hacking font-lock-keywords on the fly a little easier, in
addition to adding to customization/granularity
(info "(elisp) Font Lock Basics")
The new regex is not too hard to generate with some set/combinatorics
fun, but perhaps going about this a different way would be better
(let ((s (delq nil (powerset '("@" "-" "+")))))
(concat "="
(regexp-opt
(mapcar (lambda (ls) (apply #'concat ls))
(apply #'append (mapcar #'permutations s)))
"\\(?1:")))