Closed xantoz closed 2 years ago
The error message might be related to this https://github.com/purcell/mmm-mode/issues/56 ?
Changed the regex defvar
s to defconst
, since they're really not runtime-changeable by rebinding the values of bitbake-shell-regex
, bitbake-python-regex
and bitbake-python-def-regex
. The regexes get baked in by the backtick quote just before the mmm-add-classes
function is called. (Technically if you could modify the regex string in place, without rebinding, it might work since both the variable and the value after :front
in the alist cell should by referencing the same string object)
To have them be properly runtime customizeable would require some sort of hook on variable change that would replace/modify the class definitions in mmm-classes-alist
, which seems like a lot of work for something that hopefully shouldn't need to be customized by the end user anyway.
The error message might be related to this purcell/mmm-mode#56 ?
Seems like it. Disabling my whitespace-mode hook stopped the error message from appearing.
Btw, a good example file for testing this is openembedded-core/meta/classes/image.bbclass
(for the record I'm on 6fa967f194edd314c9026c80f8d93360ac6d9efa
)
Link: https://git.openembedded.org/openembedded-core/tree/meta/classes/image.bbclass
I don't have the opportunity to test at the moment, I'm on macos rn and I have no easy way to test but this looks okay to me, did you run the test suite ?
did you run the test suite ? How do I run it?
cask exec ert-runner
Thank you! could you just confirm the tests are passing cask exe ert-runner
and if you feel like it, add yourself to the contributors list. I'll merge this then.
Thank you!
Just some things that occurred to me when I started using this (mostly to get syntax highlighting working ok).
Still a bit of a WIP. There's some more improvement that could be done to use character classes in the existing regexes (like
[:alnum:]
).I also get the following warning message directly after switching to
mmm-mode
. This started happening after my changes to matching ofbitbake-shell
andbitbake-python
:Despite this warning I don't see any big issues, except fontlock sometimes getting confused around the borders of python regions (but that seems to have been happening before as well), and not updating the syntax highlighting until you modify the code around it a bit.