Function: gnus-agent-save-active

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

Signature

(gnus-agent-save-active METHOD &optional GROUPS-P)

Documentation

Sync the agent's active file with the current buffer.

Pass non-nil for GROUPS-P if the buffer starts out in groups format. Regardless, both the file and the buffer end up in active format if METHOD is agentized; otherwise the function is a no-op.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-agent.el.gz
(defun gnus-agent-save-active (method &optional groups-p)
  "Sync the agent's active file with the current buffer.
Pass non-nil for GROUPS-P if the buffer starts out in groups format.
Regardless, both the file and the buffer end up in active format
if METHOD is agentized; otherwise the function is a no-op."
  (when (gnus-agent-method-p method)
    (let* ((gnus-command-method method)
	   (new (gnus-make-hashtable (count-lines (point-min) (point-max))))
	   (file (gnus-agent-lib-file "active")))
      (if groups-p
	  (gnus-groups-to-gnus-format nil new)
	(gnus-active-to-gnus-format nil new))
      (gnus-agent-write-active file new)
      (erase-buffer)
      (let ((nnheader-file-coding-system gnus-agent-file-coding-system))
	(nnheader-insert-file-contents file)))))