From: morioka Date: Sun, 13 Jul 1997 16:43:26 +0000 (+0000) Subject: (eword-addr-spec-to-rwl): New implementation. X-Git-Tag: semi-0_97~10 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1afab2536c586d9e27bc2a4b9085f3604b3c18ea;p=elisp%2Fsemi.git (eword-addr-spec-to-rwl): New implementation. --- diff --git a/eword-encode.el b/eword-encode.el index 1f376ff..a21c7a1 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Revision: 0.26 $ +;; Version: $Revision: 0.27 $ ;; Keywords: encoded-word, MIME, multilingual, header, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -36,7 +36,7 @@ ;;; (defconst eword-encode-RCS-ID - "$Id: eword-encode.el,v 0.26 1997-07-13 16:32:21 morioka Exp $") + "$Id: eword-encode.el,v 0.27 1997-07-13 16:43:26 morioka Exp $") (defconst eword-encode-version (get-version-string eword-encode-RCS-ID)) @@ -457,8 +457,47 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (defun eword-addr-spec-to-rwl (addr-spec) (if (eq (car addr-spec) 'addr-spec) - (list (list (std11-addr-to-string (cdr addr-spec)) nil nil)) - )) + (let ((seq (cdr addr-spec)) + dest pname) + (while seq + (let* ((token (car seq)) + (name (car token)) + ) + (cond ((eq name 'spaces) + (setq dest (nconc dest (list (list (cdr token) nil nil)))) + ) + ((eq name 'comment) + (setq dest + (nconc + dest + (list (list "(" nil nil)) + (tm-eword::split-string (cdr token) 'comment) + (list (list ")" nil nil)) + )) + ) + ((eq name 'quoted-string) + (setq dest + (nconc + dest + (list + (list (concat "\"" (cdr token) "\"") nil nil) + ))) + ) + (t + (setq dest + (if (or (eq pname 'spaces) + (eq pname 'comment)) + (nconc dest (list (list (cdr token) nil nil))) + (nconc (butlast dest) + (list + (list (concat (car (car (last dest))) + (cdr token)) + nil nil))))) + )) + (setq seq (cdr seq) + pname name)) + ) + dest))) (defun tm-eword::mailbox-to-rwl (mbox) (let ((addr (nth 1 mbox))