* TESTPAT: Add 16 tests.
authorakr <akr>
Tue, 1 Sep 1998 12:43:36 +0000 (12:43 +0000)
committerakr <akr>
Tue, 1 Sep 1998 12:43:36 +0000 (12:43 +0000)
* 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'.

ChangeLog
TESTPAT
ew-data.el
ew-quote.el
ew-var.el

index 710cb90..d6d091f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 1998-09-01  Tanaka Akira      <akr@jaist.ac.jp>
 
+       * 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      <akr@jaist.ac.jp>
+
        * 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 (file)
--- a/TESTPAT
+++ b/TESTPAT
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
  =?ISO-2022-JP?B?GyRCJCIbKEI=?=)(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)")
 
+(encode
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?\e$(C$!\e(B?"
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6ShPw==?=")
+
+(encode
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?\e$(C$!\e(B?"
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=")
+
+(encode
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?\e$(C$!\e(B?"
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=")
+
+(encode
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?\e$(C$!\e(B?"
+"Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ =?EUC-KR?B?P6ShPw==?=")
+
 ;----------------------------------------------------------------------------
 
 ;;; Section 6: Encoding melancholic inputs.
  =?ISO-2022-JP?B?GyRCJCgbKEI=?= <foo@bar>"
 'separate-sticked-special)
 
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6ShPw==?=()aaaaa\r
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaa <akr@jaist.ac.jp>"
+'("From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaa <akr@jaist.ac.jp>"
+  "From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r
+ =?EUC-KR?B?pKE/?=()aaaaa <akr@jaist.ac.jp>")
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=
+ =?US-ASCII?Q?=3F?=()aaaaa <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+'("From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+  "From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r
+ =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>")
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r
+ =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r
+ =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+"From:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?US-ASCII?Q?=3F?=\r
+ =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ <akr@jaist.ac.jp>"
+'permit-sticked-comment)
+
+(encode
+"From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()?\e$(C$!\e(B?()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa <akr@jaist.ac.jp>"
+'("From:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()=?EUC-KR?B?P6Sh?=\r
+ =?US-ASCII?Q?=3F?=()=?US-ASCII?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?=\r
+ =?US-ASCII?Q?aaaaaaaaaaaaaaaa?= <akr@jaist.ac.jp>"
+  "From: =?US-ASCII?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?=
+ =?US-ASCII?Q?aa?=()=?US-ASCII?Q?=3F?=\r 
+ =?EUC-KR?B?pKE/?=()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
+ <akr@jaist.ac.jp>")
+'permit-sticked-comment)
+
+;----------------------------------------------------------------------------
+
 ;;; Section 7: Using embedded-encoded-words.
 ;;
 ;; embedded-encoded-word \e$BI=8=\e(B
 ;;    1/3 (\e$B>.?tE@0J2<@Z<N$F\e(B)\e$B$K$7$F!":G8e$N\e(B = \e$B$r<h$j=|$$$?J8;zNs\e(B
 ;;
 ;;  =?c?e?t?=?c?e?t?=... \e$B$H$$$&$h$&$K!"%Q%?!<%s$N@hF,$N\e(B = \e$B$H\e(B \e$BKvHx$N\e(B = 
-;;  \e$B=E$J$k>l9g!"4q?tHVL\$N$b$N$KBP$7$F>e5-$N%k!<%k$rE,MQ$9$k!#\e(B
+;;  \e$B$,=E$J$k>l9g!"4q?tHVL\$N$b$N$KBP$7$F>e5-$N%k!<%k$rE,MQ$9$k!#\e(B
 ;;
 ;; NOTE: + \e$B$r\e(B embedded-encoded-word \e$BI=8=$N\e(B quote \e$BJ8;z$H8F$V!#\e(B
 ;;
index 436b014..3a2a1f7 100644 (file)
@@ -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)))))
          (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))
index e95bfb0..fd66130 100644 (file)
@@ -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)
index 2463626..4d9a0bf 100644 (file)
--- a/ew-var.el
+++ b/ew-var.el
 ;;; 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
           (regexp-quote "?")
           "\\(" ew-token-regexp "\\)"
           (regexp-quote "?")
-          "\\(" ew-encoded-text-regexp "\\)"
+          "\\(" ew-encoded-text-regexp0 "\\)"
           (regexp-quote "?")
           "\\'"))