diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-03-18 05:10:32 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-03-18 05:10:37 +0100 |
commit | 1e9c9ebee3e13773400fe93bf26db923a880be6d (patch) | |
tree | 650020311d344c87f84766ceb18a4ef40fc99078 /lisp/font-lock.el | |
parent | 485622bbd1afad4c1e39a245cf57605208ca606f (diff) | |
download | emacs-1e9c9ebee3e13773400fe93bf26db923a880be6d.tar.gz emacs-1e9c9ebee3e13773400fe93bf26db923a880be6d.tar.bz2 emacs-1e9c9ebee3e13773400fe93bf26db923a880be6d.zip |
Unbind `M-o' and add new `C-x x f' binding
* doc/lispref/modes.texi (Other Font Lock Variables):
`font-lock-fontify-block' is no longer bound.
* lisp/bindings.el (ctl-x-x-map): Bind `font-lock-update'.
* lisp/font-lock.el (font-lock-update): New command written by
Gregory Heytings <gregory@heytings.org>.
* lisp/loadup.el: Remove transitional experimental code.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index c344a612581..82915d8c8b0 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1120,6 +1120,18 @@ portion of the buffer." (funcall font-lock-ensure-function (or beg (point-min)) (or end (point-max))))) +(defun font-lock-update (&optional arg) + "Updates the syntax highlighting in this buffer. +Refontify the accessible portion of this buffer, or enable Font Lock mode +in this buffer if it is currently disabled. With prefix ARG, toggle Font +Lock mode." + (interactive "P") + (save-excursion + (if (and (not arg) font-lock-mode) + (font-lock-fontify-region (point-min) (point-max)) + (font-lock-unfontify-region (point-min) (point-max)) + (font-lock-mode 'toggle)))) + (defun font-lock-default-fontify-buffer () "Fontify the whole buffer using `font-lock-fontify-region-function'." (let ((verbose (if (numberp font-lock-verbose) |