Skip to content

Commit 76b17df

Browse files
committed
Defer fontification while typing
When input is pending, skip font-lock work until Emacs is idle again. This prevents syntax highlighting from competing with keystrokes in large or complex buffers, keeping typing smooth. Available since Emacs 29.
1 parent 9492060 commit 76b17df

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/prelude-editor.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ Does not indent if the mode is in `prelude-indent-sensitive-modes'."
374374
;; servers and other processes that produce large output.
375375
(setq read-process-output-max (* 1024 1024)) ; 1MB
376376

377+
;; defer fontification while there is input pending -- this keeps
378+
;; typing responsive in large/complex buffers where font-lock is slow
379+
(setq redisplay-skip-fontification-on-input t)
380+
377381
;; Compilation from Emacs
378382
(use-package compile
379383
:defer t

0 commit comments

Comments
 (0)