* message.el (message-add-action): Use add-to-list.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 6 Mar 2002 17:52:50 +0000 (17:52 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 6 Mar 2002 17:52:50 +0000 (17:52 +0000)
(message-delete-action): New function.

* nndoc.el (nndoc-mail-in-mail-type-p): Break a long regexp into
pieces.

lisp/ChangeLog
lisp/message.el
lisp/nndoc.el

index fbf61f2..68f99a3 100644 (file)
@@ -1,5 +1,8 @@
 2002-03-06  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
+       * message.el (message-add-action): Use add-to-list.
+       (message-delete-action): New function.
+
        * nndoc.el (nndoc-mail-in-mail-type-p): Break a long regexp into
        pieces.
 
index a03c1be..f7b5b31 100644 (file)
@@ -2764,10 +2764,16 @@ It should typically alter the sending method in some way or other."
 
 (defun message-add-action (action &rest types)
   "Add ACTION to be performed when doing an exit of type TYPES."
+  (while types
+    (add-to-list (intern (format "message-%s-actions" (pop types)))
+                action)))
+
+(defun message-delete-action (action &rest types)
+  "Delete ACTION from lists of actions performed when doing an exit of type TYPES."
   (let (var)
     (while types
       (set (setq var (intern (format "message-%s-actions" (pop types))))
-          (nconc (symbol-value var) (list action))))))
+          (delq action (symbol-value var))))))
 
 (defun message-do-actions (actions)
   "Perform all actions in ACTIONS."
index 3bcec06..b3a287b 100644 (file)
@@ -706,16 +706,35 @@ from the document.")
   (nndoc-oe-dbx-generate-article article 'head))
 
 (defun nndoc-mail-in-mail-type-p ()
-  (save-excursion
-    (while (re-search-forward "\n\n[-A-Za-z0-9]+:" nil t)
-      (forward-line)
-      (while (looking-at "[ \t]\\|[-A-Za-z0-9]+:")
-       (forward-line))
-      (looking-at "\n"))))
+  (let (found)
+    (save-excursion
+      (catch 'done
+       (while (re-search-forward "\n\n[-A-Za-z0-9]+:" nil t)
+         (setq found 0)
+         (forward-line)
+         (while (looking-at "[ \t]\\|[-A-Za-z0-9]+:")
+           (if (looking-at "[-A-Za-z0-9]+:")
+               (setq found (1+ found)))
+           (forward-line))
+         (if (and (> found 0) (looking-at "\n"))
+             (throw 'done 9999)))
+       nil))))
 
 (defun nndoc-mail-in-mail-article-begin ()
-  (when (re-search-forward "^[-A-Za-z0-9]+: .*\n\\([ \t]?.*\n\\)*\\(^[-A-Za-z0-9]+: .*\n\\([ \t]?.*\n\\)*\\)+\n" nil t)
-    (goto-char (match-beginning 0))))
+  (let (point found)
+    (if (catch 'done
+         (while (re-search-forward "\n\n\\([-A-Za-z0-9]+:\\)" nil t)
+           (setq found 0)
+           (setq point (match-beginning 1))
+           (forward-line)
+           (while (looking-at "[ \t]\\|[-A-Za-z0-9]+:")
+             (if (looking-at "[-A-Za-z0-9]+:")
+                 (setq found (1+ found)))
+             (forward-line))
+           (if (and (> found 0) (looking-at "\n"))
+               (throw 'done t)))
+         nil)
+       (goto-char point))))
 
 (deffoo nndoc-request-accept-article (group &optional server last)
   nil)