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.
This commit is contained in:
parent
485622bbd1
commit
1e9c9ebee3
5 changed files with 20 additions and 26 deletions
|
@ -3247,8 +3247,7 @@ set by means of @var{other-vars} in @code{font-lock-defaults}
|
|||
@defvar font-lock-mark-block-function
|
||||
If this variable is non-@code{nil}, it should be a function that is
|
||||
called with no arguments, to choose an enclosing range of text for
|
||||
refontification for the command @kbd{M-o M-o}
|
||||
(@code{font-lock-fontify-block}).
|
||||
refontification for the command @kbd{M-x font-lock-fontify-block}.
|
||||
|
||||
The function should report its choice by placing the region around it.
|
||||
A good choice is a range of text large enough to give proper results,
|
||||
|
|
7
etc/NEWS
7
etc/NEWS
|
@ -93,6 +93,10 @@ useful on systems such as FreeBSD which ships only with "etc/termcap".
|
|||
|
||||
* Changes in Emacs 28.1
|
||||
|
||||
+++
|
||||
** New command 'font-lock-update', bound to 'C-x x f'.
|
||||
This command updates the syntax highlighting in this buffer.
|
||||
|
||||
** The new NonGNU ELPA archive is enabled by default alongside GNU ELPA.
|
||||
|
||||
+++
|
||||
|
@ -2254,7 +2258,8 @@ first).
|
|||
Use 'M-x center-line' and 'M-x center-paragraph' instead.
|
||||
|
||||
** The 'M-o M-o' global binding have been removed.
|
||||
Use 'M-x font-lock-fontify-block' instead.
|
||||
Use 'M-x font-lock-fontify-block' instead, or the new `C-x x f'
|
||||
command, which toggles fontification in the current buffer.
|
||||
|
||||
** In 'f90-mode', the backslash character ('\') no longer escapes.
|
||||
For about a decade, the backslash character has no longer had a
|
||||
|
|
|
@ -1432,6 +1432,7 @@ if `inhibit-field-text-motion' is non-nil."
|
|||
|
||||
(defvar ctl-x-x-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map "f" #'font-lock-update)
|
||||
(define-key map "g" #'revert-buffer)
|
||||
(define-key map "r" #'rename-buffer)
|
||||
(define-key map "u" #'rename-uniquely)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -477,29 +477,6 @@ lost after dumping")))
|
|||
(setq redisplay--inhibit-bidi nil)
|
||||
|
||||
|
||||
;; Experimental feature removal.
|
||||
(define-key global-map "\M-o" #'removed-facemenu-command)
|
||||
|
||||
(defun removed-facemenu-command ()
|
||||
"Transition command during test period for facemenu removal."
|
||||
(interactive)
|
||||
(switch-to-buffer "*Facemenu Removal*")
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(insert-file-contents
|
||||
(expand-file-name "facemenu-removal.txt" data-directory)))
|
||||
(goto-char (point-min))
|
||||
(special-mode))
|
||||
|
||||
(defun facemenu-keymap-restore ()
|
||||
"Restore the facemenu keymap."
|
||||
;; Global bindings:
|
||||
(define-key global-map [C-down-mouse-2] 'facemenu-menu)
|
||||
(define-key global-map "\M-o" 'facemenu-keymap)
|
||||
(define-key facemenu-keymap "\eS" 'center-paragraph)
|
||||
(define-key facemenu-keymap "\es" 'center-line)
|
||||
(define-key facemenu-keymap "\M-o" 'font-lock-fontify-block))
|
||||
|
||||
|
||||
(if dump-mode
|
||||
(let ((output (cond ((equal dump-mode "pdump") "emacs.pdmp")
|
||||
|
|
Loading…
Add table
Reference in a new issue