On 02/22/2016 11:40 AM, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Clément Pit--Claudel >> 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?