Perform large-file checks after major-mode is decided
Fixes an issue where pdfs (in pdf-view-mode) weren't been converted correctly because the file was declared large while it was being read in fundamental-mode.
This commit is contained in:
parent
cb495aabe6
commit
dc24237800
1 changed files with 4 additions and 4 deletions
|
@ -39,13 +39,13 @@ possible."
|
|||
(if (setq doom-large-file-p
|
||||
(and buffer-file-name
|
||||
(not doom-large-file-p)
|
||||
(not (memq major-mode doom-large-file-excluded-modes))
|
||||
(file-readable-p buffer-file-name)
|
||||
(> (nth 7 (file-attributes buffer-file-name))
|
||||
(* 1024 1024 doom-large-file-size))))
|
||||
(delay-mode-hooks
|
||||
(prog1 (apply orig-fn args)
|
||||
(buffer-disable-undo)
|
||||
(if (memq major-mode doom-large-file-excluded-modes)
|
||||
(setq doom-large-file-p nil)
|
||||
(so-long-minor-mode +1)
|
||||
(message "Large file detected! Cutting a few corners to improve performance...")))
|
||||
(apply orig-fn args)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue