emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font-lock-fontify-block


From: Gregory Heytings
Subject: Re: font-lock-fontify-block
Date: Fri, 12 Mar 2021 14:23:43 +0000


Indeed (but that one, just like `font-lock-fontify-block`) suffers from a heavy heritage so it's messy and misused, so I'd be very happy to obsolete it (by replacing it with something simpler and that only caters to the relevant cases).

Another question: is font-lock-fontify-region also among the functions you'd like to obsolete?

`font-lock-fontify-region` is an important function internally (it's the one and only function which performs font-locking, fundamentally), so no.


Thank you. That was my impression, too, but I wasn't 100% sure. Given this, my updated suggestion is:

(defun font-lock-update (&optional arg)
  (interactive "P")
  (save-mark-and-excursion
    (if (not arg)
        (font-lock-fontify-region (point-min) (point-max))
      (font-lock-unfontify-region (point-min) (point-max))
      (font-lock-mode 'toggle))))
(global-set-key (kbd "C-x x f") 'font-lock-update)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]