From 9f1f2fe1abcb8765dc6a86fd254a7d75ceb35e8c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 26 Jun 2002 07:46:14 +0000 Subject: [PATCH] * contrib/hashcash.el (mail-add-payment): Allow no `mail-header-separator' in the buffer; don't use `mapc'. --- ChangeLog | 2 ++ contrib/hashcash.el | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) 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) -- 1.7.10.4