Optimize opening large files #1834

Fixes an issue where dtrt-indent and/or nav-flash would hang Emacs when
opening large files, and disables all mode hooks for large
files (without using fundamental-mode so you can at least get syntax
highlighting).
This commit is contained in:
Henrik Lissner 2019-10-07 16:02:23 -04:00
parent 2a943437a2
commit 616dec5b93
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 42 additions and 4 deletions

View file

@ -16,7 +16,8 @@ jumping to another part of the file)."
(defun +nav-flash-blink-cursor-maybe (&rest _)
"Like `+nav-flash-blink-cursor', but no-ops if in special-mode or term-mode,
or triggered from one of `+nav-flash-exclude-commands'."
(unless (or (derived-mode-p 'special-mode 'term-mode)
(unless (or (bound-and-true-p so-long-enabled)
(derived-mode-p 'special-mode 'term-mode)
(memq this-command +nav-flash-exclude-commands)
(and (equal (point-marker) (car +nav-flash--last-point))
(equal (selected-window) (cdr +nav-flash--last-point))))