* wl-summary.el (wl-summary-prefetch-msg): Make the confirmation
authorokada <okada>
Fri, 27 Aug 2010 10:14:22 +0000 (10:14 +0000)
committerokada <okada>
Fri, 27 Aug 2010 10:14:22 +0000 (10:14 +0000)
message human-readable.

wl/ChangeLog
wl/wl-summary.el

index a9460c8..3b66758 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-27  Kenichi Okada  <okada@opaopa.org>
+
+       * wl-summary.el (wl-summary-prefetch-msg): Make the confirmation
+       message human-readable.
+
 2010-08-26  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl-e21.el (wl-draft-insert-signature): Fix comment style.
index cb4b661..d9a685c 100644 (file)
@@ -1596,7 +1596,7 @@ If ARG is non-nil, checking is omitted."
                    (widen)
                    (y-or-n-p
                     (format
-                     "Message from %s has %d bytes.  Prefetch it? "
+                     "Message from %s has %s bytes.  Prefetch it? "
                      (concat
                       "[ "
                       (save-match-data
@@ -1612,7 +1612,10 @@ If ARG is non-nil, checking is omitted."
                              'from)
                             "??")))))
                       " ]")
-                     size))))
+                     (do ((size (/ size 1024.0) (/ size 1024.0))
+                          ;; kilo, mega, giga, tera, peta, exa
+                          (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes)))
+                         ((< size 1024) (format "%.0f%s" size (car post-fixes))))))))
            (message "")))              ; flush.
        (if force-read
            (save-excursion