* wl-summary.el (wl-summary-default-from): Return full-name part
authorueno <ueno>
Sun, 27 Aug 2000 03:14:21 +0000 (03:14 +0000)
committerueno <ueno>
Sun, 27 Aug 2000 03:14:21 +0000 (03:14 +0000)
from the address if no petname was found.
(wl-summary-simple-from): Ditto.

* wl-address.el (wl-address-get-petname): Return nil if no petname
associated with the address was found.

wl/ChangeLog
wl/wl-address.el
wl/wl-summary.el

index 076c32a..1db5c9b 100644 (file)
@@ -1,3 +1,12 @@
+2000-08-27   Daiki Ueno  <ueno@unixuser.org>
+
+       * wl-summary.el (wl-summary-default-from): Return full-name part
+       from the address if no petname was found.
+       (wl-summary-simple-from): Ditto.
+
+       * wl-address.el (wl-address-get-petname): Return nil if no petname
+       associated with the address was found.
+
 2000-08-23  Masahiro MURATA  <muse@ba2.so-net.ne.jp>
 
        * wl-folder.el (wl-folder-open-all): Remove progress gauge when
index a7eda88..293c514 100644 (file)
@@ -540,10 +540,9 @@ Matched address lists are append to CL."
            (forward-line))
          ret))))
 
-(defsubst wl-address-get-petname (str)
-  (let ((addr (downcase (wl-address-header-extract-address str))))
-    (or (elmo-get-hash-val addr wl-address-petname-hash)
-       str)))
+(defsubst wl-address-get-petname (string)
+  (let ((address (downcase (wl-address-header-extract-address string))))
+    (elmo-get-hash-val address wl-address-petname-hash)))
 
 (defsubst wl-address-user-mail-address-p (address)
   "Judge whether ADDRESS is user's or not."
index afe979f..53ac569 100644 (file)
                              (function
                               (lambda (to)
                                 (eword-decode-string
-                                 (if wl-use-petname
-                                     (wl-address-get-petname to)
-                                   (or
-                                    (car (std11-extract-address-components to))
-                                    to)))))
+                                 (or (if wl-use-petname
+                                         (wl-address-get-petname to))
+                                     (car
+                                      (std11-extract-address-components to))
+                                     to))))
                              (wl-parse-addresses tos)
                              ","))))
              ((setq ng (elmo-msgdb-overview-entity-get-extra-field
                         entity "newsgroups"))
               (setq retval (concat "Ng:" ng)))))
-      (if wl-use-petname
-         (setq retval (wl-address-get-petname from))
-       (setq retval from)))
+      (setq retval
+           (or (if wl-use-petname
+                   (wl-address-get-petname from))
+               (car (std11-extract-address-components from))
+               from)))
     retval))
 
 (defun wl-summary-simple-from (string)
-  (if wl-use-petname
-      (wl-address-get-petname string)
-    string))
+  (or (if wl-use-petname
+         (wl-address-get-petname string))
+      (car (std11-extract-address-components string))
+      string))
 
 (defvar wl-summary-mode-menu-spec
   '("Summary"