From 4611681ea4c9011f0f2eb5eb6685e72627934c07 Mon Sep 17 00:00:00 2001 From: morioka Date: Sat, 21 Jun 1997 15:13:52 +0000 Subject: [PATCH] (tm-eword::lc-words-to-words): New implementation; function `tm-eword::parse-word' was abolished. --- eword-encode.el | 63 ++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/eword-encode.el b/eword-encode.el index 807896e..ae61a16 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.21 $ +;; Version: $Revision: 0.22 $ ;; 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.21 1997-06-21 14:39:38 morioka Exp $") + "$Id: eword-encode.el,v 0.22 1997-06-21 15:13:52 morioka Exp $") (defconst eword-encode-version (get-version-string eword-encode-RCS-ID)) @@ -110,7 +110,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is ))) -;;; @ leading char +;;; @ charset word ;;; (defsubst eword-encode-char-type (character) @@ -144,37 +144,34 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is ;;; @ word ;;; -(defun tm-eword::parse-word (lcwl) - (let* ((lcw (car lcwl)) - (lc (car lcw)) - ) - (if (null lc) - lcwl - (let ((lcl (list lc)) - (str (cdr lcw)) - ) - (catch 'tag - (while (setq lcwl (cdr lcwl)) - (setq lcw (car lcwl)) - (setq lc (car lcw)) - (if (null lc) - (throw 'tag nil) - ) - (if (not (memq lc lcl)) - (setq lcl (cons lc lcl)) +(defun tm-eword::lc-words-to-words (charset-words) + (let (dest) + (while charset-words + (let* ((charset-word (car charset-words)) + (charset (car charset-word)) + ) + (if charset + (let ((charsets (list charset)) + (str (cdr charset-word)) + ) + (catch 'tag + (while (setq charset-words (cdr charset-words)) + (setq charset-word (car charset-words) + charset (car charset-word)) + (if (null charset) + (throw 'tag nil) + ) + (or (memq charset charsets) + (setq charsets (cons charset charsets)) + ) + (setq str (concat str (cdr charset-word))) + )) + (setq dest (cons (cons charsets str) dest)) ) - (setq str (concat str (cdr lcw))) - )) - (cons (cons lcl str) lcwl) - )))) - -(defun tm-eword::lc-words-to-words (lcwl) - (let (ret dest) - (while (setq ret (tm-eword::parse-word lcwl)) - (setq dest (cons (car ret) dest)) - (setq lcwl (cdr ret)) - ) - (reverse dest) + (setq dest (cons charset-word dest) + charset-words (cdr charset-words) + )))) + (nreverse dest) )) -- 1.7.10.4