-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frequent font-lock glitches, especially when opening a file #122
Comments
I know that @dgutov has provided tips in past issues, so perhaps look for similar ones. In general there's a wide range of "cheating" things that major modes can do which stop them from working smoothly with |
I suggest you check out https://github.com/purcell/mmm-mode/blob/master/mmm-erb.el#L86-L98 and see whether a similar derived mode for Python is appropriate. Or use In short: when two major modes' syntax definitions conflict, it's helpful to specifically annotate certain characters inside the "inner" regions as |
You didn't post the configuration used, though. Or an example file. So the problem could be different and solvable in some easier way. |
I fear that this is difficult to reproduce, even if I share my complete configuration (or a minimal example thereof). FWIW, the directly involved part in my .emacs is:
My docstring layout in Python files is like this one:
That’s why I asked for the best way to debug oneself, as I have no error message currently. |
Try adding (setq mmm-parse-when-idle t) Does that decrease the glitches, or make it worse? |
This does not change anything noticeable. Interestingly enough, I activated this option (with delay 0.2), visited a totally misformatted part of my file, inserted a letter, waited, but nothing happened. A |
Did you try putting that line in your init script? It only takes effect when the minor mode function is running. A |
I put it in my |
OK, how hard is it to reproduce? A repro is: a sample file (in text, the shorter the better) and some example steps to see the problem. |
I admit that I must make this issue actionable. I will create a minimal example soon, hoping that it’s not too much dependent on races that only happen on some computers. |
I've also seen this with my bitbake-mode https://bitbucket.org/olanilsson/bitbake-modes/src/master/bitbake-mmm.el . |
The outer mode's font-lock may work fine, it's usually the conflict between the syntaxes of the major modes which can create problems. Does by any chance the patch in #112 (comment) fix that behavior for you? |
I observe incomplete syntax highlighting when using mmm-mode for having reStructuredText in Python docstrings, embedded into otherwise Python files. If I revert the buffer, those glitches are healed in most cases. I attached a screenshot where in the second
plot_url
, onlyt_url
is correctly highlighted.And idea how such a thing can be debugged?
The text was updated successfully, but these errors were encountered: