From cecff39a7e574b04306042ea16ccd20e9fb4bfde Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 7 May 2018 18:14:45 +0200 Subject: [PATCH] Refactor doom|check-large-file --- core/core-editor.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index ed13be421..35d51aec4 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -56,14 +56,13 @@ modes are active and the buffer is read-only.") "Check if the buffer's file is large (see `doom-large-file-size'). If so, ask for confirmation to open it literally (read-only, disabled undo and in fundamental-mode) for performance sake." - (let* ((filename (buffer-file-name)) - (size (nth 7 (file-attributes filename)))) + (let ((size (nth 7 (file-attributes buffer-file-name)))) (when (and (not (memq major-mode doom-large-file-modes-list)) size (> size (* 1024 1024 doom-large-file-size)) (y-or-n-p (format (concat "%s is a large file, open literally to " "avoid performance issues?") - (file-relative-name filename)))) + (file-relative-name buffer-file-name)))) (setq buffer-read-only t) (buffer-disable-undo) (fundamental-mode))))