* wl/wl-summary.el (wl-summary-mode): Check with fboundp before calling `make-local...
[elisp/wanderlust.git] / wl / wl-summary.el
index 63cabbe..857ee19 100644 (file)
@@ -952,13 +952,15 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
        (wl-summary-window-scroll-functions))
   (when wl-summary-buffer-window-scroll-functions
     (let ((hook (if wl-on-xemacs 'pre-idle-hook 'window-scroll-functions)))
-      (make-local-hook hook)
+      (if (fboundp 'make-local-hook)
+         (make-local-hook hook))
       (dolist (function wl-summary-buffer-window-scroll-functions)
        (add-hook hook function nil t)))
     (add-hook 'window-size-change-functions
              #'wl-summary-after-resize-function))
   (dolist (hook '(change-major-mode-hook kill-buffer-hook))
-    (make-local-hook hook)
+    (if (fboundp 'make-local-hook)
+       (make-local-hook hook))
     (add-hook hook #'wl-summary-buffer-detach nil t))
   ;; This hook may contain the function `wl-setup-summary' for reasons
   ;; of system internal to accord facilities for the Emacs variants.
@@ -1596,7 +1598,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 +1614,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
@@ -3143,7 +3148,7 @@ Return non-nil if the mark is updated"
                  (new-mark (wl-summary-persistent-mark number status)))
              (prog1
                  (unless (string= new-mark mark)
-                   (delete-backward-char 1)
+                   (delete-char -1)
                    (insert new-mark)
                    (wl-summary-set-message-modified)
                    t)
@@ -4746,7 +4751,7 @@ If ARG is numeric number, decode message as following:
   (let ((number (wl-summary-message-number))
        (folder wl-summary-buffer-elmo-folder))
     (if number
-       (let ((raw (elmo-message-fetch-string 
+       (let ((raw (elmo-message-fetch-string
                    folder number
                    (elmo-find-fetch-strategy folder number)))
              (raw-buffer (get-buffer-create "*wl:raw message*"))