* wl-summary.el (wl-summary-default-from): Use
authorteranisi <teranisi>
Wed, 15 May 2002 06:07:58 +0000 (06:07 +0000)
committerteranisi <teranisi>
Wed, 15 May 2002 06:07:58 +0000 (06:07 +0000)
wl-address-header-extract-address instead of std11-extract-address-components.
(wl-summary-simple-from): Ditto.
(wl-summary-goto-folder-subr): Check wl-summary-cache-use.
(wl-summary-insert-headers): Show message.
(wl-summary-create-line): Set 4th argument of wl-set-string-width
for whole line.

* wl-util.el (wl-set-string-width): Added 4th argument ignore-invalid;
Don't call itself recursively (Adviced by Yamaoka-san).

wl/ChangeLog
wl/wl-summary.el
wl/wl-util.el

index 3c39ca7..9d1f81f 100644 (file)
@@ -1,3 +1,17 @@
+2002-05-15  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-summary.el (wl-summary-default-from): Use
+       wl-address-header-extract-address instead of
+       std11-extract-address-components.
+       (wl-summary-simple-from): Ditto.
+       (wl-summary-goto-folder-subr): Check wl-summary-cache-use.
+       (wl-summary-insert-headers): Show message.
+       (wl-summary-create-line): Set 4th argument of wl-set-string-width
+       for whole line.
+
+       * wl-util.el (wl-set-string-width): Added 4th argument ignore-invalid;
+       Don't call itself recursively (Adviced by Yamaoka-san).
+
 2002-05-14  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
        * wl-summary.el (wl-summary-save-view-cache): In temporary buffer,
index e5ee370..b8d7f7e 100644 (file)
                                 (eword-decode-string
                                  (if wl-use-petname
                                      (or
-                                      (funcall wl-summary-get-petname-function to)
-                                      (car
-                                       (std11-extract-address-components to))
+                                      (funcall
+                                       wl-summary-get-petname-function to)
+                                      (wl-address-header-extract-address to)
                                       to)
                                    to))))
                              (wl-parse-addresses tos)
               (setq retval (concat "Ng:" ng)))))
       (if wl-use-petname
          (setq retval (or (funcall wl-summary-get-petname-function from)
-                          (car (std11-extract-address-components from))
+                          (wl-address-header-extract-address from)
                           from))
        (setq retval from)))
     retval))
 (defun wl-summary-simple-from (string)
   (if wl-use-petname
       (or (funcall wl-summary-get-petname-function string)
-         (car (std11-extract-address-components string))
+         (wl-address-header-extract-address string)
          string)
     string))
 
@@ -913,7 +913,6 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
     (setq wl-summary-buffer-delete-list nil)
     (setq wl-summary-delayed-update nil)
     (elmo-kill-buffer wl-summary-search-buf-name)
-    (message "Constructing summary structure...")
     (while curp
       (setq entity (car curp))
       (wl-summary-append-message-func-internal entity msgdb nil)
@@ -2433,9 +2432,10 @@ If ARG, without confirm."
            (wl-summary-update-modeline)))
       (unless (eq wl-summary-buffer-view 'thread)
        (wl-summary-make-number-list))
-      (when (or (and wl-summary-check-line-format
-                    (wl-summary-line-format-changed-p))
-               (wl-summary-view-old-p))
+      (when (and wl-summary-cache-use
+                (or (and wl-summary-check-line-format
+                         (wl-summary-line-format-changed-p))
+                    (wl-summary-view-old-p)))
        (wl-summary-rescan))
       (wl-summary-toggle-disp-msg (if wl-summary-buffer-disp-msg 'on 'off))
       (unless (and reuse-buf keep-cursor)
@@ -2605,6 +2605,7 @@ If ARG, without confirm."
                        wl-summary-alike-hashtb)))
 
 (defun wl-summary-insert-headers (overview func mime-decode)
+  (message "Creating subject cache...")
   (let (ov this last alike)
     (buffer-disable-undo (current-buffer))
     (make-local-variable 'wl-summary-alike-hashtb)
@@ -2629,6 +2630,7 @@ If ARG, without confirm."
                                  elmo-mime-charset)
       (when (eq mime-decode 'mime)
        (eword-decode-region (point-min) (point-max))))
+    (message "Creating subject cache...done")
     (run-hooks 'wl-summary-insert-headers-hook)))
 
 (defun wl-summary-search-by-subject (entity overview)
@@ -4246,7 +4248,8 @@ If ARG, exit virtual folder."
     (setq line (funcall wl-summary-buffer-line-formatter))
     (if wl-summary-width (setq line
                               (wl-set-string-width
-                               (- wl-summary-width 1) line)))
+                               (- wl-summary-width 1) line nil
+                               'ignore-invalid)))
     (setq line (concat line
                       "\r"
                       (number-to-string
index d1f69b3..22275d1 100644 (file)
@@ -173,12 +173,15 @@ If HACK-ADDRESSES is t, then the strings are considered to be mail addresses,
 ;;(defalias 'wl-set-hash-val 'elmo-set-hash-val)
 ;;(make-obsolete 'wl-set-hash-val 'elmo-set-hash-val)
 
-(defsubst wl-set-string-width (width string &optional padding)
+(defsubst wl-set-string-width (width string &optional padding ignore-invalid)
   "Make a new string which have specified WIDTH and content of STRING.
+`wl-invalid-character-message' is used when invalid character is contained.
 If WIDTH is negative number, padding chars are added to the head and
 otherwise, padding chars are added to the tail of the string.
 The optional 3rd arg PADDING, if non-nil, specifies a padding character
-to add the result instead of white space."
+to add the result instead of white space.
+If optional 4th argument is non-nil, don't use `wl-invalid-character-message'
+even when invalid character is contained."
   (static-cond
    ((and (fboundp 'string-width) (fboundp 'truncate-string-to-width)
         (not (featurep 'xemacs)))
@@ -186,16 +189,17 @@ to add the result instead of white space."
        (setq string (truncate-string-to-width string (abs width))))
     (if (= (string-width string) (abs width))
        string
-      (if (< (abs width) (string-width string))
-         (wl-set-string-width width
-                              wl-invalid-character-message
-                              padding)
-       (let ((paddings (make-string
-                        (max 0 (- (abs width) (string-width string)))
-                        (or padding ?\ ))))
-         (if (< width 0)
-             (concat paddings string)
-           (concat string paddings))))))
+      (when (and (not ignore-invalid)
+                (< (abs width) (string-width string)))
+       (setq string
+             (truncate-string-to-width wl-invalid-character-message
+                                       (abs width))))
+      (let ((paddings (make-string
+                      (max 0 (- (abs width) (string-width string)))
+                      (or padding ?\ ))))
+       (if (< width 0)
+           (concat paddings string)
+         (concat string paddings)))))
    (t
     (elmo-set-work-buf
      (elmo-set-buffer-multibyte default-enable-multibyte-characters)