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.
(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."
(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)