message.el (message-cite-prefix-regexp): Fix wrong change I did when merging Gnus...
[gnus] / lisp / message.el
index 7dc6df9..40c4577 100644 (file)
@@ -460,7 +460,7 @@ A value of nil means let mailer mail back a message to report errors."
   :link '(custom-manual "(message)Sending Variables")
   :type 'boolean)
 
-(defcustom message-generate-new-buffers 'unique
+(defcustom message-generate-new-buffers 'unsent
   "*Say whether to create a new message buffer to compose a message.
 Valid values include:
 
@@ -483,6 +483,7 @@ function
   If this is a function, call that function with three parameters:
   The type, the To address and the group name (any of these may be nil).
   The function should return the new buffer name."
+  :version "24.1"
   :group 'message-buffers
   :link '(custom-manual "(message)Message Buffers")
   :type '(choice (const nil)
@@ -621,23 +622,29 @@ Done before generating the new subject of a forward."
   :type 'regexp)
 
 (defcustom message-cite-prefix-regexp
-  (if (string-match "[[:digit:]]" "1")
-      ;; Support POSIX?  XEmacs 21.5.27 doesn't.
-      "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+"
-    ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
-    (let (non-word-constituents)
-      (with-syntax-table text-mode-syntax-table
-       (setq non-word-constituents
-             (concat
-              (if (string-match "\\w" "_")  "" "_")
-              (if (string-match "\\w" ".")  "" "."))))
-      (if (equal non-word-constituents "")
-         "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+"
-       (concat "\\([ \t]*\\(\\w\\|["
-               non-word-constituents
-               "]\\)+>+\\|[ \t]*[]>|}]\\)+"))))
+  ;; Default to the value of `mail-citation-prefix-regexp' if available.
+  ;; Note: as for XEmacs 21.4 and 21.5, it is unavailable unless sendmail.el
+  ;; is loaded.
+  (cond ((boundp 'mail-citation-prefix-regexp)
+        mail-citation-prefix-regexp)
+       ((string-match "[[:digit:]]" "1")
+        ;; Support POSIX?  XEmacs 21.5.27 doesn't.
+        "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+")
+       (t
+        ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
+        (let (non-word-constituents)
+          (with-syntax-table text-mode-syntax-table
+            (setq non-word-constituents
+                  (concat
+                   (if (string-match "\\w" "_")  "" "_")
+                   (if (string-match "\\w" ".")  "" "."))))
+          (if (equal non-word-constituents "")
+              "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+"
+            (concat "\\([ \t]*\\(\\w\\|["
+                    non-word-constituents
+                    "]\\)+>+\\|[ \t]*[]>|}]\\)+")))))
   "*Regexp matching the longest possible citation prefix on a line."
-  :version "23.2"
+  :version "24.1"
   :group 'message-insertion
   :link '(custom-manual "(message)Insertion Variables")
   :type 'regexp
@@ -1698,13 +1705,14 @@ functionality to work."
                 (const :tag "Never" nil)
                 (const :tag "Always" t)))
 
-(defcustom message-generate-hashcash (if (executable-find "hashcash") t)
+(defcustom message-generate-hashcash (if (executable-find "hashcash") 'opportunistic)
   "*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'."
+  :version "24.1"
   :group 'message-headers
   :link '(custom-manual "(message)Mail Headers")
   :type '(choice (const :tag "Always" t)
@@ -5320,8 +5328,14 @@ Otherwise, generate and save a value for `canlock-password' first."
 
 (defun message-output (filename)
   "Append this article to Unix/babyl mail file FILENAME."
-  (if (and (file-readable-p filename)
-          (mail-file-babyl-p filename))
+  (if (or (and (file-readable-p filename)
+              (mail-file-babyl-p filename))
+         ;; gnus-output-to-mail does the wrong thing with live, mbox
+         ;; Rmail buffers in Emacs 23.
+         ;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597255
+         (let ((buff (find-buffer-visiting filename)))
+           (and buff (with-current-buffer buff
+                       (eq major-mode 'rmail-mode)))))
       (gnus-output-to-rmail filename t)
     (gnus-output-to-mail filename t)))
 
@@ -6660,7 +6674,7 @@ want to get rid of this query permanently.")))
                    (setq recipients (delq recip recipients))))))))
 
       (setq recipients (message-prune-recipients recipients))
-      
+
       ;; Build the header alist.  Allow the user to be asked whether
       ;; or not to reply to all recipients in a wide reply.
       (setq follow-to (list (cons 'To (cdr (pop recipients)))))
@@ -6677,7 +6691,7 @@ want to get rid of this query permanently.")))
 (defun message-prune-recipients (recipients)
   (dolist (rule message-prune-recipient-rules)
     (let ((match (car rule))
-         dup-match 
+         dup-match
          address)
       (dolist (recipient recipients)
        (setq address (car recipient))