Function: gnus-agent-save-local

gnus-agent-save-local is an autoloaded and byte-compiled function defined in gnus-agent.el.gz.

Signature

(gnus-agent-save-local &optional FORCE)

Documentation

Save gnus-agent-article-local under it method's agent.lib directory.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-agent.el.gz
(defun gnus-agent-save-local (&optional force)
  "Save `gnus-agent-article-local' under it method's agent.lib directory."
  (let ((hashtb gnus-agent-article-local))
    (when (and hashtb
               (or force (gethash "+dirty" hashtb)))
      (let* ((gnus-command-method (gethash "+method" hashtb))
             ;; NOTE: gnus-command-method is used within gnus-agent-lib-file.
             (dest (gnus-agent-lib-file "local")))
        (gnus-make-directory (gnus-agent-lib-file ""))

	(let ((coding-system-for-write gnus-agent-file-coding-system)
	      (file-name-coding-system nnmail-pathname-coding-system))
	  (with-temp-file dest
	    ;; FIXME: Why are we letting this again?
	    (let ((gnus-command-method (gethash "+method" hashtb))
		  print-level print-length
		  (standard-output (current-buffer)))
	      (maphash (lambda (group active)
			 (cond ((null active)
				nil)
			       ((member group '("+dirty" "+method"))
				nil)
			       (t
				(when active
				  (prin1 group)
				  (princ " ")
				  (princ (car active))
				  (princ " ")
				  (princ (cdr active))
				  (princ "\n")))))
		       hashtb))))))))