|
From: | Gregory Heytings |
Subject: | Re: font-lock-fontify-block |
Date: | Thu, 11 Mar 2021 21:57:18 +0000 |
Would you be OK with the idea of deprecating the use of `font-lock-fontify-block' for the specific case where font-lock is not enabled?I only ever use it in that case to _remove_ the faces from text yanked from a fontified buffer. So that's another important use case for M-o M-o.Actually, I see I've misremembered: this is handy not when font-lock-mode is off, but when it's on and I yank text from another mode. A typical use case is when I yank from some program fragment into a text-mode buffer: the original fontification is left alone until I type M-o M-o.
I have four remarks:1. I was surprised to read this, it's something I never see. It turns out that I don't see this because I have in my .emacs:
(global-whitespace-mode 1) (setq whitespace-style '(face trailing empty))2. That being said, font-lock-fontify-block is not a good solution to that problem, it doesn't work when the yanked text is larger than 16 lines, except of course with a prefix argument.
3. font-lock-flush would not solve that problem, it has no apparent effect in the case you mention.
4. Is this not something that could/should be done inside yank, with (if font-lock-mode (font-lock-fontify-region (point-min) (point-max)))?
[Prev in Thread] | Current Thread | [Next in Thread] |