hlolli / csound-mode

Emacs major mode for coding in Csound
41 stars 14 forks source link

Make font-lock work instantly #12

Closed raxod502 closed 4 years ago

raxod502 commented 4 years ago

I do not know what the purpose of this setting was, but removing it eliminates a bug which causes syntax highlighting to be nondeterministically delayed, because Emacs is smart enough these days to handle font-lock itself for the most part.

hlolli commented 4 years ago

I'll test it now, but the reason was first that this is my first major mode, so I think I was copying what others were doing, font-locking has been very painful, because I was trying to font lock depending on if the region belongs to the orchestra or score section. That was probably a mistake, because the main gain I wanted was rainbow delimited P-fields, and when it's enabled, the buffer becomes super slow.

Reply in a bit...

hlolli commented 4 years ago

This works fine, the rainbow thingy is broken, but it was broken and needs a lot of rework. And I'm happy to remove those homebrewed flush/region functions, since I bet the native font-lock behaviour is much better. I felt that I encountered setq font-lock-fontify-region setters quite a lot in the wild.

Thanks again!