* gnus-art.el (gnus-use-idna)
[gnus] / lisp / nnagent.el
index ef41d44..0c1dbc6 100644 (file)
@@ -10,7 +10,7 @@
 
 ;; 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
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
   (gnus-request-accept-article "nndraft:queue" nil t t))
 
 (deffoo nnagent-request-set-mark (group action server)
-  (with-temp-buffer
+  (mm-with-unibyte-buffer
     (insert "(gnus-agent-synchronize-group-flags \""
            group 
            "\" '")
            (gnus-method-to-server gnus-command-method)
            "\"")
     (insert ")\n")
-    (write-region (point-min) (point-max) (gnus-agent-lib-file "flags")
-                 t 'silent))
+    (let ((coding-system-for-write nnheader-file-coding-system))
+      (write-region (point-min) (point-max) (gnus-agent-lib-file "flags")
+                   t 'silent)))
+  ;; Also set the marks for the original back end that keeps marks in
+  ;; the local system.
+  (let ((gnus-agent nil))
+    (when (and (memq (car gnus-command-method) '(nntp))
+              (gnus-check-backend-function 'request-set-mark
+                                           (car gnus-command-method)))
+      (funcall (gnus-get-function gnus-command-method 'request-set-mark)
+              group action server)))
   nil)
 
 (deffoo nnagent-retrieve-headers (articles &optional group server fetch-old)
          (pop arts)))
       (set-buffer nntp-server-buffer)
       (erase-buffer)
-      (nnheader-insert-nov-file file (car articles))
+      (let ((file-name-coding-system nnmail-pathname-coding-system))
+       (nnheader-insert-nov-file file (car articles)))
       (goto-char (point-min))
       (gnus-parse-without-error
        (while (and arts (not (eobp)))