* doc/lispref/modes.texi (Font Lock Basics): Document it.
* lisp/font-lock.el (font-lock-refontify): New convenience command.
@var{end} default to the beginning and the end of the buffer's
accessible portion. Calls the function specified by
@code{font-lock-ensure-function}.
+
+@item font-lock-refontify
+This is a convenience command meant to be used when developing font
+locking for a mode, and should not be called from Lisp code. It
+recomputes all the relevant variables and then calls
+@code{font-lock-ensure} on the entire buffer.
@end ftable
There are several variables that control how Font Lock mode highlights
\f
* Changes in Specialized Modes and Packages in Emacs 27.1
++++
+** New command 'font-lock-refontify'.
+This is an interactive convenience function to be used when developing
+font locking for a mode. It recomputes the font locking data and then
+re-fontifies the buffer.
+
---
** The 'C' command in 'tar-mode' will now preserve the timestamp of
the extracted file if the new user option 'tar-copy-preserve-time' is
"Function to make sure a region has been fontified.
Called with two arguments BEG and END.")
+(defun font-lock-refontify ()
+ "Reinitialise the font-lock machinery and re-fontify the buffer.
+This functions is a convenience functions when developing font
+locking for a mode, and is not meant to be called from lisp functions."
+ (interactive)
+ (declare (interactive-only t))
+ (setq font-lock-major-mode nil)
+ (font-lock-ensure))
+
(defun font-lock-ensure (&optional beg end)
"Make sure the region BEG...END has been fontified.
If the region is not specified, it defaults to the entire accessible