[mew-dist 23488] Re: displaying body

Tatsuya Kinoshita tats at example.com
2003年 3月 29日 (土) 20:57:15 JST


On March 17, 2003, [mew-dist 23309],
Tatsuya Kinoshita <tats at example.com> wrote:

> 正規表現の変更を出しておきます。

.mew.elで実験しづらいので、とりあえず変数にしました。(正規表現も
少し変更しています)

-- tats

 This patch is written by Tatsuya Kinoshita.  Copyright is disclaimed.

--- mew-scan.el	2003/03/29 00:34:37	1.169
+++ mew-scan.el	2003/03/29 11:41:51
@@ -513,6 +513,21 @@
 		  (setq regex-list (cdr regex-list)))))))))
     ret))
 
+(defvar mew-regex-ignore-scan-body-list
+  '("^[ \t]*$"
+    "^[ \t]*[-a-zA-Z0-9]+: "
+    "^[ \t]*[>:|#;/_}]"
+    "^[ \t]*\\w+\\(['._-]+\\w+\\)*>"
+    "^[ \t]*[[</(.]+ *snip"
+    "^   "
+    "^--"
+    "^- --"
+    "^=2D"
+    "^.*\\(:\\|;\\|/\\)[ \t]*$"
+    "^.*\\(wrote\\|writes?\\|said\\|says?\\)[^.!\n]?[ \t]*$"
+    "^[ \t]*\\(On\\|At\\) .*[^.! \t\n][ \t]*$"
+    "^[ \t]*In \\(message\\|article\\|<\\|\"\\)"))
+
 (defun mew-scan-body (mew-vec &optional draftp)
   (forward-line)
   (let* ((i 0) (I mew-scan-max-body-length)
@@ -558,21 +573,15 @@
     (when (and textp (mew-coding-system-p cs))
       (setq i 0)
       (while (and (not (eobp)) (< i I) (< j J))
-	(setq use nil)
-	(or
-	 (looking-at "^[ \t]*$")
-	 (looking-at "^[ \t]*[-a-zA-Z0-9]+: ")
-	 (looking-at "^[ \t]*[>:|#;/_}]")
-	 (looking-at "^[ \t]*\\w+\\(['._-]+\\w+\\)*>")
-	 (looking-at "^  ")
-	 (looking-at "^--")
-	 (looking-at "^- --")
-	 (looking-at "^=2D")
-	 (looking-at "^.*\\(:\\|;\\|/\\)[ \t]*$")
-	 (looking-at "^.*\\(wrote\\|writes?\\|said\\|says?\\)[^.!\n]?[ \t]*$")
-	 (looking-at "^[ \t]*\\(On\\|At\\) .*[^.! \t\n][ \t]*$")
-	 (looking-at "^[ \t]*In \\(message\\|article\\|<\\|\"\\)")
-	 (setq use t))
+	(setq use
+	      (not
+	       (catch 'matched
+		 (let (regex)
+		   (setq regex mew-regex-ignore-scan-body-list)
+		   (while regex
+		     (if (looking-at (car regex))
+			 (throw 'matched t))
+		     (setq regex (cdr regex)))))))
 	(if (not use)
 	    (forward-line)
 	  (when (looking-at "^[ \t]+")



Mew-dist メーリングリストの案内