Synch with `t-gnus-6_14' and Gnus.
[elisp/gnus.git-] / lisp / nnmail.el
index 6f0e139..cdf997e 100644 (file)
@@ -176,7 +176,13 @@ Eg.:
                 (function :format "%v" nnmail-)))
 
 (defcustom nnmail-expiry-target 'delete
-  "*Variable that says where expired messages should end up."
+  "*Variable that says where expired messages should end up.
+The default value is `delete' (which says to delete the messages),
+but it can also be a string or a function.  If it is a string, expired
+messages end up in that group.  If it is a function, the function is
+called in a buffer narrowed to the message in question.  The function
+receives one argument, the name of the group the message comes from.
+The return value should be `delete' or a group name (a string)."
     :group 'nnmail-expire
     :type '(choice (const delete)
                   (function :format "%v" nnmail-)
@@ -237,9 +243,9 @@ running (\"xwatch\", etc.)
 Eg.
 
 \(add-hook 'nnmail-read-incoming-hook
-          (lambda ()
-            (start-process \"mailsend\" nil
-                           \"/local/bin/mailsend\" \"read\" \"mbox\")))
+          (lambda ()
+            (call-process \"/local/bin/mailsend\" nil nil nil
+                          \"read\" nnmail-spool-file)))
 
 If you have xwatch running, this will alert it that mail has been
 read.
@@ -460,7 +466,8 @@ parameter.  It should return nil, `warn' or `delete'."
 (defvar nnmail-file-coding-system 'raw-text
   "Coding system used in nnmail.")
 
-(defvar nnmail-incoming-coding-system 'raw-text
+(defvar nnmail-incoming-coding-system
+  nnheader-text-coding-system
   "Coding system used in reading inbox")
 
 (defvar nnmail-pathname-coding-system 'binary
@@ -471,9 +478,10 @@ parameter.  It should return nil, `warn' or `delete'."
   (set-buffer nntp-server-buffer)
   (delete-region (point-min) (point-max))
   (let ((format-alist nil)
-        (after-insert-file-functions nil))
+       (after-insert-file-functions nil))
     (condition-case ()
        (let ((auto-mode-alist (nnheader-auto-mode-alist))
+             (file-name-coding-system nnmail-pathname-coding-system)
              (pathname-coding-system nnmail-pathname-coding-system))
          (insert-file-contents-as-coding-system
           nnmail-file-coding-system file)
@@ -1515,8 +1523,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
         (new 0)
         (total 0)
         incoming incomings source)
-    (when (and (nnmail-get-value "%s-get-new-mail" method)
-              sources)
+    (when (nnmail-get-value "%s-get-new-mail" method)
       (while (setq source (pop sources))
        ;; Be compatible with old values.
        (cond
@@ -1618,7 +1625,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
   (when (nnheader-functionp target)
     (setq target (funcall target group)))
   (unless (eq target 'delete)
-    (gnus-request-accept-article target)))
+    (gnus-request-accept-article target nil nil t)))
 
 (defun nnmail-check-syntax ()
   "Check (and modify) the syntax of the message in the current buffer."
@@ -1630,8 +1637,8 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
 
 (defun nnmail-write-region (start end filename &optional append visit lockname)
   "Do a `write-region', and then set the file modes."
-  (let ((pathname-coding-system nnmail-pathname-coding-system))
-    
+  (let ((file-name-coding-system nnmail-pathname-coding-system)
+       (pathname-coding-system nnmail-pathname-coding-system))
     (write-region-as-coding-system
      nnmail-file-coding-system start end filename append visit lockname)
     (set-file-modes filename nnmail-default-file-modes)))