projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shr: Render td content with shr-descend
[gnus]
/
lisp
/
hashcash.el
diff --git
a/lisp/hashcash.el
b/lisp/hashcash.el
index
a6d148c
..
efa27c3
100644
(file)
--- a/
lisp/hashcash.el
+++ b/
lisp/hashcash.el
@@
-1,6
+1,7
@@
;;; hashcash.el --- Add hashcash payments to email
;;; hashcash.el --- Add hashcash payments to email
-;; Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation
+;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+;; Free Software Foundation
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: Paul Foley <mycroft@actrix.gen.nz>
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: Paul Foley <mycroft@actrix.gen.nz>
@@
-8,20
+9,18
@@
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software
;
you can redistribute it and/or modify
+;; GNU Emacs is free software
:
you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation
; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation
, either version 3 of the License, or
+;;
(at your option)
any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Commentary:
@@
-49,9
+48,12
@@
;;; Code:
;;; Code:
+;; For Emacs <22.2 and XEmacs.
(eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+(eval-when-compile (require 'cl)) ; for case
+
(defgroup hashcash nil
"Hashcash configuration."
:group 'mail)
(defgroup hashcash nil
"Hashcash configuration."
:group 'mail)
@@
-115,8
+117,6
@@
For example, you may want to set this to '(\"-Z2\") to reduce header length."
(require 'mail-utils)
(eval-and-compile
(require 'mail-utils)
(eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
-
(if (fboundp 'point-at-bol)
(defalias 'hashcash-point-at-bol 'point-at-bol)
(defalias 'hashcash-point-at-bol 'line-beginning-position))
(if (fboundp 'point-at-bol)
(defalias 'hashcash-point-at-bol 'point-at-bol)
(defalias 'hashcash-point-at-bol 'line-beginning-position))
@@
-131,10
+131,10
@@
For example, you may want to set this to '(\"-Z2\") to reduce header length."
(concat (match-string 1 addr) (match-string 2 addr))
addr))
(concat (match-string 1 addr) (match-string 2 addr))
addr))
-(declare-function
message-narrow-to-headers-or-head "message" ())
-(declare-function
message-fetch-field "message" (header &optional not-all))
-(declare-function
message-goto-eoh "message" ())
-(declare-function
message-narrow-to-headers "message" ())
+(declare-function message-narrow-to-headers-or-head "message" ())
+(declare-function message-fetch-field "message" (header &optional not-all))
+(declare-function message-goto-eoh "message" ())
+(declare-function message-narrow-to-headers "message" ())
(defun hashcash-token-substring ()
(save-excursion
(defun hashcash-token-substring ()
(save-excursion
@@
-161,8
+161,7
@@
For example, you may want to set this to '(\"-Z2\") to reduce header length."
"Generate a hashcash payment by finding a VAL-bit collison on STR."
(if (and (> val 0)
hashcash-path)
"Generate a hashcash payment by finding a VAL-bit collison on STR."
(if (and (> val 0)
hashcash-path)
- (save-excursion
- (set-buffer (get-buffer-create " *hashcash*"))
+ (with-current-buffer (get-buffer-create " *hashcash*")
(erase-buffer)
(apply 'call-process hashcash-path nil t nil
"-m" "-q" "-b" (number-to-string val) str
(erase-buffer)
(apply 'call-process hashcash-path nil t nil
"-m" "-q" "-b" (number-to-string val) str
@@
-278,7
+277,7
@@
BUFFER defaults to the current buffer."
(unless buffer (setq buffer (current-buffer)))
(let (entry)
(while (setq entry (rassq buffer hashcash-process-alist))
(unless buffer (setq buffer (current-buffer)))
(let (entry)
(while (setq entry (rassq buffer hashcash-process-alist))
- (accept-process-output (car entry)))))
+ (accept-process-output (car entry)
1
))))
(defun hashcash-processes-running-p (buffer)
"Return non-nil if hashcash processes in BUFFER are still running."
(defun hashcash-processes-running-p (buffer)
"Return non-nil if hashcash processes in BUFFER are still running."
@@
-288,7
+287,7
@@
BUFFER defaults to the current buffer."
"Ask user whether to wait for hashcash processes to finish."
(interactive)
(when (hashcash-processes-running-p (current-buffer))
"Ask user whether to wait for hashcash processes to finish."
(interactive)
(when (hashcash-processes-running-p (current-buffer))
- (if (y-or-n-p
+ (if (y-or-n-p
"Hashcash process(es) still running; wait for them to finish? ")
(hashcash-wait-async)
(hashcash-cancel-async))))
"Hashcash process(es) still running; wait for them to finish? ")
(hashcash-wait-async)
(hashcash-cancel-async))))
@@
-377,4
+376,4
@@
Prefix arg sets default accept amount temporarily."
(provide 'hashcash)
(provide 'hashcash)
-;;
arch-tag: 0e7fe983-a124-4392-9788-0dbcbd2c4d62
+;;
; hashcash.el ends here