(message-generate-hashcash): Expand range of values to
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 20 Nov 2006 23:15:21 +0000 (23:15 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 20 Nov 2006 23:15:21 +0000 (23:15 +0000)
include `opportunistic'.
(message-send-mail): Use it.

lisp/ChangeLog
lisp/message.el
lisp/nntp.el

index 607b28a..fba2adc 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-generate-hashcash): Expand range of values to
+       include `opportunistic'.
+       (message-send-mail): Use it.
+
 2006-11-14  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-util.el (gnus-extract-address-components): Work with address in
index 6b024e4..0438a79 100644 (file)
@@ -1579,10 +1579,16 @@ functionality to work."
 
 (defcustom message-generate-hashcash (if (executable-find "hashcash") t)
   "*Whether to generate X-Hashcash: headers.
+If `t', always generate hashcash headers.  If `opportunistic',
+only generate hashcash headers if it can be done without the user
+waiting (i.e., only asynchronously).
+
 You must have the \"hashcash\" binary installed, see `hashcash-path'."
   :group 'message-headers
   :link '(custom-manual "(message)Mail Headers")
-  :type 'boolean)
+  :type '(choice (const :tag "Always" t)
+                (const :tag "Never" nil)
+                (const :tag "Opportunistic" 'opportunistic)))
 
 ;;; Internal variables.
 
@@ -4128,7 +4134,8 @@ not have PROP."
              (gnus-setup-posting-charset nil)
            message-posting-charset))
         (headers message-required-mail-headers))
-    (when message-generate-hashcash
+    (when (and message-generate-hashcash
+              (not (eq message-generate-hashcash 'opportunistic)))
       (message "Generating hashcash...")
       ;; Wait for calculations already started to finish...
       (hashcash-wait-async)
index 340b96b..2ef6de3 100644 (file)
@@ -1205,7 +1205,7 @@ password contained in '~/.nntp-authinfo'."
                (funcall nntp-open-connection-function pbuffer))
            (error nil)
            (quit
-            (message "Quit opening connection")
+            (message "Quit opening connection to %s" nntp-address)
             (nntp-kill-buffer pbuffer)
             (signal 'quit nil)
             nil))))