Conversation
font-lock-refresh-defaults can set font-lock-mode to t even if global-font-lock-mode and font-lock-global-modes are nil. So save the original value of font-lock-mode and set it back to nil if it was nil to begin with.
|
You may wish to submit this to http://github.com/jrblevin/markdown-mode instead, since that's the official repo. This one is just a mirror. |
|
Ooops, thanks! On Wed, Sep 2, 2015 at 3:04 PM, Keshav Kini notifications@github.com
|
|
I just merged this in to the main repository. Thanks for the patch and sorry for the long delay in getting it in. I haven't been checking this mirror for pull requests. For future reference, markdown-mode is now on GitHub officially here: https://github.com/jrblevin/markdown-mode |
|
This just ruined my highlighting. |
|
Do you have font-lock-mode turned off globally? If I understand, the original problem was that when font-lock-mode was disabled globally, it would get turned back on by I checked and the entire body of (font-lock-mode -1)
(kill-local-variable 'font-lock-set-defaults)
(font-lock-mode 1)So, I'm now not convinced that this patch is the best way to solve the problem. I will look into other solutions. |
|
I confirmed the issue with |
|
There's probably some reason why I didn't just do (when (and (font-lock-mode) (fboundp 'font-lock-refresh-defaults)) but the font-lock code is so twisted I don't remember what it was. Maybe I On Mon, Jan 11, 2016 at 5:28 AM, Jason Blevins notifications@github.com
|
|
I remembered why I did this patch by saving and restoring font-lock-mode: it's not apparent why font-lock-refresh-defaults is being called here, or what it's doing that is useful. But, it was enabling font-lock-mode which should be a decision made by the user (markdown-mode should/does work fine without it AFAIK). So to keep whatever functionality it may be doing that is useful or required, but keep it from overstepping its bounds and enabling font-lock-mode, I did the save/restore. But it looks like that doesn't work. Oops. |
font-lock-refresh-defaults can set font-lock-mode to t even if global-font-lock-mode and font-lock-global-modes are nil. So save the original value of font-lock-mode and set it back to nil if it was nil to begin with.
This is probably an issue with font-lock-refresh-defaults but this hack makes markdown-mode readable for me.