mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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)))
|
||||
|
||||
|
Reference in New Issue
Block a user