[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What to do when font-lock-flush + font-lock-ensure do less than font
From: |
Clément Pit--Claudel |
Subject: |
Re: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? |
Date: |
Mon, 22 Feb 2016 12:28:13 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 02/22/2016 11:40 AM, Eli Zaretskii wrote:
>> Cc: address@hidden
>> From: Clément Pit--Claudel <address@hidden>
>> Date: Mon, 22 Feb 2016 11:29:10 -0500
>>
>>> I think what you describe _is_ the proper way. Can you show a test
>>> case which demonstrates how calling font-lock-flush followed by
>>> font-lock-ensure fails to do the job?
>>
>> In any case where font-lock-fontified is nil
>> font-lock-fontify-buffer will properly refontify the whole buffer,
>> but font-lock-flush and font-lock ensure will not do anything.
>
> That's not what I see in the code, that's why I asked for a test
> case. I'm probably missing something.
Here's a test case:
(with-current-buffer (get-buffer-create "temp")
(erase-buffer)
(setq-default prettify-symbols-unprettify-at-point 'right-edge)
(emacs-lisp-mode)
(prettify-symbols-mode)
(insert "lambda\n\nlambda")
(pop-to-buffer (current-buffer)))
Moving around in this buffer unprettifies and reprettifies ‘lambda’s into ‘λ’s
as the point moves in and out of them. Setting ‘font-lock-fontified’ to nil
breaks that mechanism (the ‘λ’s are unprettified but no reprettified), and no
series of ‘font-lock-flush’ and ‘font-lock-ensure’ will reprettify them.
Does this help?
signature.asc
Description: OpenPGP digital signature
Re: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer?, Stefan Monnier, 2016/02/23