From: morioka Date: Sat, 21 Jun 1997 14:39:38 +0000 (+0000) Subject: `tm-eword::split-to-lc-words' -> X-Git-Tag: semi-0_96~34 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=70f5d37854e562e13c3d1a29edc303d486266aad;p=elisp%2Fsemi.git `tm-eword::split-to-lc-words' -> `eword-encode-divide-into-charset-words'. --- diff --git a/eword-encode.el b/eword-encode.el index da911a0..807896e 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.20 $ +;; Version: $Revision: 0.21 $ ;; 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.20 1997-06-21 14:25:21 morioka Exp $") + "$Id: eword-encode.el,v 0.21 1997-06-21 14:39:38 morioka Exp $") (defconst eword-encode-version (get-version-string eword-encode-RCS-ID)) @@ -119,24 +119,25 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (char-charset character) )) -(defun tm-eword::split-to-lc-words (str) - (let (ret dest) - (while (not (string= str "")) - (let* ((chr (sref str 0)) +(defun eword-encode-divide-into-charset-words (string) + (let ((len (length string)) + dest) + (while (> len 0) + (let* ((chr (sref string 0)) (charset (eword-encode-char-type chr)) (i (char-bytes chr)) - (len (length str)) ) (while (and (< i len) - (setq chr (sref str i)) + (setq chr (sref string i)) (eq charset (eword-encode-char-type chr)) ) (setq i (+ i (char-bytes chr))) ) - (setq dest (cons (cons charset (substring str 0 i)) dest) - str (substring str i)) - )) - (reverse dest) + (setq dest (cons (cons charset (substring string 0 i)) dest) + string (substring string i) + len (- len i) + ))) + (nreverse dest) )) @@ -244,9 +245,10 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (defun tm-eword::split-string (str &optional mode) (tm-eword::space-process - (tm-eword::words-to-ruled-words (tm-eword::lc-words-to-words - (tm-eword::split-to-lc-words str)) - mode))) + (tm-eword::words-to-ruled-words + (tm-eword::lc-words-to-words + (eword-encode-divide-into-charset-words str)) + mode))) ;;; @ length @@ -417,17 +419,20 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is '(("(" nil nil)) (tm-eword::words-to-ruled-words (tm-eword::lc-words-to-words - (tm-eword::split-to-lc-words (cdr token))) + (eword-encode-divide-into-charset-words + (cdr token))) 'comment) '((")" nil nil)) )) ) (t - (setq dest (append dest - (tm-eword::words-to-ruled-words - (tm-eword::lc-words-to-words - (tm-eword::split-to-lc-words (cdr token)) - ) 'phrase))) + (setq dest + (append dest + (tm-eword::words-to-ruled-words + (tm-eword::lc-words-to-words + (eword-encode-divide-into-charset-words + (cdr token)) + ) 'phrase))) )) (setq phrase (cdr phrase)) )