(rfc822/extract-address-components): fixed.
[elisp/mu-cite.git] / tl-822.el
index 0a52c08..3464c68 100644 (file)
--- a/tl-822.el
+++ b/tl-822.el
@@ -30,7 +30,7 @@
 
 
 (defconst rfc822/RCS-ID
-  "$Id: tl-822.el,v 7.56 1996-08-28 20:32:07 morioka Exp $")
+  "$Id: tl-822.el,v 7.60 1996-08-28 22:52:29 morioka Exp $")
 (defconst rfc822/version (get-version-string rfc822/RCS-ID))
 
 
 
 (defalias 'rfc822/parse-address                'std11-parse-address)
 (defalias 'rfc822/parse-addresses      'std11-parse-addresses)
+(defalias 'rfc822/address-string       'std11-address-string)
+(defalias 'rfc822/full-name-string     'std11-full-name-string)
 
-(defun rfc822/addr-to-string (seq)
-  (mapconcat (function
-             (lambda (token)
-               (if (eq (car token) 'spaces)
-                   ""
-                 (cdr token)
-                 )))
-            seq "")
-  )
-
-(defun rfc822/address-string (address)
-  (cond ((eq (car address) 'group)
-        (mapconcat (function rfc822/address-string)
-                   (nth 2 address)
-                   ", ")
-        )
-       ((eq (car address) 'mailbox)
-        (let ((addr (nth 1 address)))
-          (rfc822/addr-to-string
-           (if (eq (car addr) 'phrase-route-addr)
-               (nth 2 addr)
-             (cdr addr)
-             )
-           )))))
-
-(defun rfc822/full-name-string (address)
-  (cond ((eq (car address) 'group)
-        (mapconcat (function
-                    (lambda (token)
-                      (cdr token)
-                      ))
-                   (nth 1 address) "")
-        )
-       ((eq (car address) 'mailbox)
-        (let ((addr (nth 1 address))
-              (comment (nth 2 address))
-              phrase)
-          (if (eq (car addr) 'phrase-route-addr)
-              (setq phrase (mapconcat (function
-                                       (lambda (token)
-                                         (cdr token)
-                                         ))
-                                      (nth 1 addr) ""))
-            )
-          (or phrase comment)
-          ))))
-
-(defun rfc822/extract-address-components (str)
-  "Extract full name and canonical address from STR.
+(defun rfc822/extract-address-components (string)
+  "Extract full name and canonical address from STRING.
 Returns a list of the form (FULL-NAME CANONICAL-ADDRESS).
 If no name can be extracted, FULL-NAME will be nil. [tl-822.el]"
-  (let* ((structure (car
-                     (rfc822/parse-address
-                      (rfc822/lexical-analyze str)
-                      )))
+  (let* ((structure (car (std11-parse-address-string string)))
          (phrase  (rfc822/full-name-string structure))
          (address (rfc822/address-string structure))
          )