fix #5448: guard nil buffer size
This commit is contained in:
parent
d52eb414bb
commit
6c17e3bc3a
|
@ -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 ()
|
||||
|
|
Loading…
Reference in a new issue