File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1359,13 +1359,13 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1359
1359
; ; Issue #104: When reverting the buffer, make sure all fontification is redone
1360
1360
; ; so that we don't end up missing a non-angle-bracket '<' or '>' character.
1361
1361
(defun rust--after-revert-hook ()
1362
- ( let
1363
- ; ; Newer emacs versions (25 and later) make `font-lock-fontify-buffer'
1364
- ; ; interactive-only, and want lisp code to call `font-lock-flush' or
1365
- ; ; `font-lock-ensure' . But those don't exist in emacs 24 and earlier .
1366
- ((font-lock-ensure-fn ( if (fboundp 'font-lock-ensure ) 'font-lock-ensure 'font-lock-fontify-buffer )) )
1367
- ( funcall font-lock-ensure-fn) )
1368
- )
1362
+ ; ; In Emacs 25 and later, the preferred method to force fontification is
1363
+ ; ; to use `font-lock-ensure' , which doesn't exist in Emacs 24 and earlier.
1364
+ ; ; If it's not available, fall back to calling `font-lock-fontify-region'
1365
+ ; ; on the whole buffer .
1366
+ ( if (fboundp 'font-lock-ensure )
1367
+ ( font-lock-ensure )
1368
+ ( font-lock-fontify-region ( point-min ) ( point-max ))) )
1369
1369
1370
1370
(defun rust--before-save-hook ()
1371
1371
(when rust-format-on-save (rust-format-buffer)))
You can’t perform that action at this time.
0 commit comments