0

If I have font-lock on and I do M-x find-library RET simple RET, I have colours: enter image description here If I then M-x font-lock-mode to disable the mode, the colours disappear in the currently-visible portion of the buffer: enter image description here But the colours are still present everywhere else if I scroll the buffer: enter image description here

This does not happen with emacs -Q. Any ideas on how to debug it?

GNU Emacs 27.1 (build 1, x86_64-apple-darwin20.3.0, NS appkit-2022.30 Version 11.2.1 (Build 20D75)) of 2021-03-13

Update: It happens with a fresh Doom emacs, so I am reporting it as an issue.

1

Can't disable font-lock-mode ... i have tried (global-font-lock-mode -1) and manually disabling font-lock-mode locally via M-x; The result (for all major modes) is that the visible lines are stripped of color

You have successfully disabled font-lock-mode.

but the other lines in the buffer are still colored.

Sure, but evidentially not via font-lock-mode. There are other ways to apply faces to text. Such cases will probably be using overlays or text properties.

I suspect your real question is something like "How do I make Emacs use the default face for all text?"

11
  • I don’t care about the colors, I just want the performance boost for large files. Is what I have done enough? And if the colors are done via other overlays, why do the visible lines lose their colors? Setting font-lock-keywords to nil also uncolors almost everything. – HappyFace Apr 24 at 10:44
  • I don't know precisely what your examples are doing (and I don't use flycheck), but clearly some of the colouring was via font-lock. If a performance boost is the goal, then what you've done is probably good -- but performance is subjective, so only you can say for sure. I generally use so-long when I want a performance boost over any other concerns. – phils Apr 24 at 11:19
  • 1
    If you still have performance concerns, please ask a separate question about that (as this question has nothing to do with performance, even if that was your goal). – phils Apr 24 at 11:35
  • 1
    So for a recipe we can all follow... if you have font-lock on and you M-x find-library RET simple RET and scroll up and down you have colours; but if you then M-x font-lock-mode to disable the mode, the colours disappear in the currently-visible portion of the buffer only, but the colours are still present everywhere else if you scroll the buffer? – phils Apr 24 at 12:10
  • 1
    In that case I'm afraid you'll probably have to debug your config to isolate what's causing it. github.com/Malabarba/elisp-bug-hunter might be very useful here. stackoverflow.com/a/23772957 describes how to do the equivalent manually. – phils Apr 25 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.