From: akr Date: Tue, 1 Sep 1998 12:43:36 +0000 (+0000) Subject: * TESTPAT: Add 16 tests. X-Git-Tag: doodle-1_9_3~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=746a098abd9001ddd0b1d08649323432ddf9b1b8;p=elisp%2Fflim.git * TESTPAT: Add 16 tests. * ew-data.el (ew-separate-eword): Check `ew-permit-null-encoded-text'. * ew-quote.el (ew-quote-concat): Use `ew-encoded-word-regexp0' instead of `ew-encoded-word-regexp'. (ew-quote-sole): Ditto. * ew-var.el (ew-encoded-text-regexp): Abolished. (ew-encoded-text-regexp0): Renamed from `ew-encoded-text-regexp'. (ew-encoded-text-regexp1): New constant. (ew-encoded-word-regexp): Abolished. (ew-encoded-word-regexp0): Renamed from `ew-encoded-word-regexp'. (ew-encoded-word-regexp1): New constant. (ew-anchored-encoded-word-regexp): Use `ew-encoded-word-regexp0'. (ew-type2-regexp): Use `ew-encoded-word-regexp0'. --- diff --git a/ChangeLog b/ChangeLog index 710cb90..d6d091f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 1998-09-01 Tanaka Akira + * TESTPAT: Add 16 tests. + + * ew-data.el (ew-separate-eword): Check + `ew-permit-null-encoded-text'. + + * ew-quote.el (ew-quote-concat): Use `ew-encoded-word-regexp0' + instead of `ew-encoded-word-regexp'. + (ew-quote-sole): Ditto. + + * ew-var.el (ew-encoded-text-regexp): Abolished. + (ew-encoded-text-regexp0): Renamed from `ew-encoded-text-regexp'. + (ew-encoded-text-regexp1): New constant. + (ew-encoded-word-regexp): Abolished. + (ew-encoded-word-regexp0): Renamed from `ew-encoded-word-regexp'. + (ew-encoded-word-regexp1): New constant. + (ew-anchored-encoded-word-regexp): Use `ew-encoded-word-regexp0'. + (ew-type2-regexp): Use `ew-encoded-word-regexp0'. + +1998-09-01 Tanaka Akira + * Sync up with flim-1_9_1. * mime-def.el (mime-library-version-string): bump up to diff --git a/TESTPAT b/TESTPAT index f417c3d..25d8305 100644 --- a/TESTPAT +++ b/TESTPAT @@ -988,6 +988,25 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r =?ISO-2022-JP?B?GyRCJCIbKEI=?=)(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)") +(encode +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?$(C$!(B?" +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6ShPw==?=") + +(encode +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?$(C$!(B?" +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=") + +(encode +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?$(C$!(B?" +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=") + +(encode +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?$(C$!(B?" +"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + =?EUC-KR?B?P6ShPw==?=") + ;---------------------------------------------------------------------------- ;;; Section 6: Encoding melancholic inputs. @@ -1098,6 +1117,96 @@ =?ISO-2022-JP?B?GyRCJCgbKEI=?= " 'separate-sticked-special) +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6ShPw==?=()aaaaa\r + " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaa " +'("From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaa " + "From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaa ") +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?= + =?US-ASCII?Q?=3F?=()aaaaa " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +'("From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " + "From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ") +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +"From: + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + " +'permit-sticked-comment) + +(encode +"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?$(C$!(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " +'("From: + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r + =?US-ASCII?Q?=3F?=()=?US-ASCII?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?=\r + =?US-ASCII?Q?aaaaaaaaaaaaaaaa?= " + "From: =?US-ASCII?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?= + =?US-ASCII?Q?aa?=()=?US-ASCII?Q?=3F?=\r + =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r + ") +'permit-sticked-comment) + +;---------------------------------------------------------------------------- + ;;; Section 7: Using embedded-encoded-words. ;; ;; embedded-encoded-word $BI=8=(B @@ -1139,7 +1248,7 @@ ;; 1/3 ($B>.?tE@0J2<@Zl9g!"4q?tHVL\$N$b$N$KBP$7$F>e5-$N%k!<%k$rE,MQ$9$k!#(B +;; $B$,=E$J$k>l9g!"4q?tHVL\$N$b$N$KBP$7$F>e5-$N%k!<%k$rE,MQ$9$k!#(B ;; ;; NOTE: + $B$r(B embedded-encoded-word $BI=8=$N(B quote $BJ8;z$H8F$V!#(B ;; diff --git a/ew-data.el b/ew-data.el index 436b014..3a2a1f7 100644 --- a/ew-data.el +++ b/ew-data.el @@ -59,7 +59,9 @@ (defun ew-separate-eword (frag1 frag2 targets) (while (not (eq frag1 frag2)) (when (and (memq (get frag1 'type) targets) - (string-match ew-encoded-word-regexp + (string-match (if ew-permit-null-encoded-text + ew-encoded-word-regexp0 + ew-encoded-word-regexp1) (symbol-name frag1)) (or (< 0 (match-beginning 0)) (< (match-end 0) (length (symbol-name frag1))))) @@ -78,7 +80,10 @@ (setq frag (cadr result))) (put frag 'prev-frag (get frag1 'prev-frag)) (put (get frag1 'prev-frag) 'next-frag frag) - (while (string-match ew-encoded-word-regexp atom start) + (while (string-match (if ew-permit-null-encoded-text + ew-encoded-word-regexp0 + ew-encoded-word-regexp1) + atom start) (when (< start (match-beginning 0)) (setq frag (make-symbol (substring atom start (match-beginning 0))) result (ew-rcons* result frag)) diff --git a/ew-quote.el b/ew-quote.el index e95bfb0..fd66130 100644 --- a/ew-quote.el +++ b/ew-quote.el @@ -43,7 +43,7 @@ (while tmp (setq str (car tmp) start 0) - (while (string-match ew-encoded-word-regexp str start) + (while (string-match ew-encoded-word-regexp0 str start) (setq eword-start (match-beginning 0) charset-start (match-beginning 1) eword-end (match-end 0)) @@ -92,7 +92,7 @@ (defun ew-quote-sole (str gen-type2) (let (result (start 0) charset-start quoting-end eword-end l) - (while (string-match ew-encoded-word-regexp str start) + (while (string-match ew-encoded-word-regexp0 str start) (setq charset-start (match-beginning 1) eword-end (match-end 0)) (string-match ew-quoting-chars-regexp str charset-start) diff --git a/ew-var.el b/ew-var.el index 2463626..4d9a0bf 100644 --- a/ew-var.el +++ b/ew-var.el @@ -123,19 +123,29 @@ ;;; constants. (defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+") -(defconst ew-encoded-text-regexp "[!->@-~]*") +(defconst ew-encoded-text-regexp0 "[!->@-~]*") +(defconst ew-encoded-text-regexp1 "[!->@-~]+") -(defconst ew-encoded-word-regexp +(defconst ew-encoded-word-regexp0 (concat (regexp-quote "=?") "\\(" ew-token-regexp "\\)" (regexp-quote "?") "\\(" ew-token-regexp "\\)" (regexp-quote "?") - "\\(" ew-encoded-text-regexp "\\)" + "\\(" ew-encoded-text-regexp0 "\\)" + (regexp-quote "?="))) + +(defconst ew-encoded-word-regexp1 + (concat (regexp-quote "=?") + "\\(" ew-token-regexp "\\)" + (regexp-quote "?") + "\\(" ew-token-regexp "\\)" + (regexp-quote "?") + "\\(" ew-encoded-text-regexp1 "\\)" (regexp-quote "?="))) (defconst ew-anchored-encoded-word-regexp - (concat "\\`" ew-encoded-word-regexp "\\'")) + (concat "\\`" ew-encoded-word-regexp0 "\\'")) (defconst ew-b-regexp (eval-when-compile @@ -165,7 +175,7 @@ (regexp-quote "?") "\\(" ew-token-regexp "\\)" (regexp-quote "?") - "\\(" ew-encoded-text-regexp "\\)" + "\\(" ew-encoded-text-regexp0 "\\)" (regexp-quote "?") "\\'"))