From 10bd1d1f7f0da2db7e08317d73361ed5b6ab4c08 Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 19 Apr 1996 18:48:55 +0000 Subject: [PATCH] (rfc822/address-string): support group (rfc822/full-name-string): support group --- tl-822.el | 58 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/tl-822.el b/tl-822.el index 4d2d12c..cd2764a 100644 --- a/tl-822.el +++ b/tl-822.el @@ -30,7 +30,7 @@ (defconst rfc822/RCS-ID - "$Id: tl-822.el,v 7.8 1996-04-15 08:57:58 morioka Exp $") + "$Id: tl-822.el,v 7.9 1996-04-19 18:48:55 morioka Exp $") (defconst rfc822/version (get-version-string rfc822/RCS-ID)) @@ -632,30 +632,42 @@ ) (defun rfc822/address-string (address) - (if (eq (car address) 'mailbox) - (let ((addr (nth 1 address)) - addr-spec) - (rfc822/addr-to-string - (if (eq (car addr) 'phrase-route-addr) - (nth 2 addr) - (cdr addr) - ) - )))) + (cond ((eq (car address) 'group) + (mapconcat (function rfc822/address-string) + (nth 2 address) + ", ") + ) + ((eq (car address) 'mailbox) + (let ((addr (nth 1 address)) + addr-spec) + (rfc822/addr-to-string + (if (eq (car addr) 'phrase-route-addr) + (nth 2 addr) + (cdr addr) + ) + ))))) (defun rfc822/full-name-string (address) - (if (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) - ))) + (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. -- 1.7.10.4