[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ugly file size reported for files bigger than 256Mb
From: |
Chris Moore |
Subject: |
ugly file size reported for files bigger than 256Mb |
Date: |
14 Nov 2003 01:52:21 +0100 |
If you try to visit a file that is bigger than 256Mb (and
large-file-warning-threshold's value is less than the size of the
file) you see a warning message like:
"File blah is large (286.102294921875MB), really open? (y or n)"
If the file is less than 256Mb the size is reported as an integer
number of megabytes.
I suggest that the '%d' format should be used to make sure an
integral value is always reported. (And what's with the funny
indentation of the 2nd argument to 'format'?)
Chris.
-------cut-here-------8<--------cut-here--------8<-------cut-here-------
Index: files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.671
diff -c -r1.671 files.el
*** files.el 5 Nov 2003 04:06:27 -0000 1.671
--- files.el 14 Nov 2003 00:42:00 -0000
***************
*** 1240,1248 ****
(not (or buf nowarn))
(> (nth 7 attributes) large-file-warning-threshold)
(not (y-or-n-p
! (format "File %s is large (%sMB), really open? "
(file-name-nondirectory filename)
! (/ (nth 7 attributes) 1048576)))))
(error "Aborted"))
(if buf
;; We are using an existing buffer.
--- 1240,1248 ----
(not (or buf nowarn))
(> (nth 7 attributes) large-file-warning-threshold)
(not (y-or-n-p
! (format "File %s is large (%dMB), really open? "
(file-name-nondirectory filename)
! (/ (nth 7 attributes) 1048576))))))
(error "Aborted"))
(if buf
;; We are using an existing buffer.
-------cut-here-------8<--------cut-here--------8<-------cut-here-------
- ugly file size reported for files bigger than 256Mb,
Chris Moore <=