diff --git a/layers/+distribution/spacemacs-base/funcs.el b/layers/+distribution/spacemacs-base/funcs.el index 9afee3dec..3b9adf9d8 100644 --- a/layers/+distribution/spacemacs-base/funcs.el +++ b/layers/+distribution/spacemacs-base/funcs.el @@ -329,12 +329,12 @@ argument takes the kindows rotate backwards." ;; check when opening large files - literal file open (defun spacemacs/check-large-file () - (when (> (nth 7 (file-attributes (buffer-file-name))) - (* 1024 1024 dotspacemacs-large-file-size)) - (when (y-or-n-p "This is a large file, open literally to avoid performance issues?") - (setq buffer-read-only t) - (buffer-disable-undo) - (fundamental-mode)))) + (let ((size (nth 7 (file-attributes (buffer-file-name))))) + (when (and size (> size (* 1024 1024 dotspacemacs-large-file-size))) + (when (y-or-n-p "This is a large file, open literally to avoid performance issues?") + (setq buffer-read-only t) + (buffer-disable-undo) + (fundamental-mode))))) ;; found at http://emacswiki.org/emacs/KillingBuffers (defun spacemacs/kill-other-buffers ()