From: yamaoka Date: Wed, 26 Jun 2002 07:46:14 +0000 (+0000) Subject: * contrib/hashcash.el (mail-add-payment): Allow no `mail-header-separator' in X-Git-Tag: t-gnus-6_15_8-00-quimby~44 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f1f2fe1abcb8765dc6a86fd254a7d75ceb35e8c;p=elisp%2Fgnus.git- * contrib/hashcash.el (mail-add-payment): Allow no `mail-header-separator' in the buffer; don't use `mapc'. --- diff --git a/ChangeLog b/ChangeLog index d9b5b74..9c4f63c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * contrib/hashcash.el: Require `cl' when compiling. (hashcash-strip-quoted-names): Replace `subseq' with `substring'. + (mail-add-payment): Allow no `mail-header-separator' in the buffer; + don't use `mapc'. 2002-06-25 TSUCHIYA Masatoshi diff --git a/contrib/hashcash.el b/contrib/hashcash.el index 264044b..1f8c3f2 100644 --- a/contrib/hashcash.el +++ b/contrib/hashcash.el @@ -1,6 +1,6 @@ ;;; hashcash.el --- Add hashcash payments to email -;; $Revision: 1.1.2.2 $ +;; $Revision: 1.1.2.3 $ ;; Copyright (C) 1997,2001 Paul E. Foley ;; Maintainer: Paul Foley @@ -96,12 +96,14 @@ Prefix arg sets default payment temporarily." (save-excursion (save-restriction (goto-char (point-min)) - (search-forward mail-header-separator) + (re-search-forward (concat "^\\(" + (regexp-quote mail-header-separator) + "\\)?$")) (beginning-of-line) (narrow-to-region (point-min) (point)) (let ((to (hashcash-strip-quoted-names (mail-fetch-field "To" nil t))) (cc (hashcash-strip-quoted-names (mail-fetch-field "Cc" nil t))) - (ng (hashcash-strip-quoted-names + (ng (hashcash-strip-quoted-names (mail-fetch-field "Newsgroups" nil t)))) (when to (setq addrlist (split-string to ",[ \t\n]*"))) @@ -109,8 +111,8 @@ Prefix arg sets default payment temporarily." (setq addrlist (nconc addrlist (split-string cc ",[ \t\n]*")))) (when ng (setq addrlist (nconc addrlist (split-string ng ",[ \t\n]*"))))) - (when addrlist - (mapc #'hashcash-insert-payment addrlist))))) + (while addrlist + (hashcash-insert-payment (pop addrlist)))))) t) (provide 'hashcash)