From 1cdda2450bf4f6053c9d845531d066079c8d774c Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 13 Jul 1997 18:13:53 +0000 Subject: [PATCH] (eword-addr-seq-to-rwl): New function. (eword-addr-spec-to-rwl): Use function `eword-addr-seq-to-rwl'. --- eword-encode.el | 89 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/eword-encode.el b/eword-encode.el index a21c7a1..3397424 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.27 $ +;; Version: $Revision: 0.28 $ ;; 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.27 1997-07-13 16:43:26 morioka Exp $") + "$Id: eword-encode.el,v 0.28 1997-07-13 18:13:53 morioka Exp $") (defconst eword-encode-version (get-version-string eword-encode-RCS-ID)) @@ -438,6 +438,48 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (tm-eword::space-process dest) )) +(defun eword-addr-seq-to-rwl (seq) + (let (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::phrase-route-addr-to-rwl (phrase-route-addr) (if (eq (car phrase-route-addr) 'phrase-route-addr) (let ((phrase (nth 1 phrase-route-addr)) @@ -457,47 +499,8 @@ 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) - (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))) + (eword-addr-seq-to-rwl (cdr addr-spec)) + )) (defun tm-eword::mailbox-to-rwl (mbox) (let ((addr (nth 1 mbox)) -- 1.7.10.4