Function: gnus-groups-to-gnus-format

gnus-groups-to-gnus-format is a byte-compiled function defined in gnus-start.el.gz.

Signature

(gnus-groups-to-gnus-format METHOD &optional HASHTB REAL-ACTIVE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-start.el.gz
(defun gnus-groups-to-gnus-format (method &optional hashtb real-active)
  ;; Parse a "groups" active file.
  (let ((cur (current-buffer))
	(hashtb (or hashtb
		    (if (and method gnus-active-hashtb)
			gnus-active-hashtb
		      (setq gnus-active-hashtb
			    (gnus-make-hashtable
			     (count-lines (point-min) (point-max)))))))
	(prefix (and method
		     (not (gnus-server-equal
			   (gnus-server-get-method nil method)
			   (gnus-server-get-method nil gnus-select-method)))
		     (gnus-group-prefixed-name "" method))))

    ;; Let the Gnus agent save the active file.
    (if (and gnus-agent
	     real-active
	     (gnus-online method)
	     (gnus-agent-method-p method))
	(progn
	  (gnus-agent-save-active method t)
	  (gnus-active-to-gnus-format method hashtb nil real-active))

      (goto-char (point-min))
      (let (min max group)
	(while (not (eobp))
	  (condition-case ()
	      (when (eq (char-after) ?2)
		(read cur) (read cur)
		(setq min (read cur)
		      max (read cur)
		      group (read cur)
		      group (if (numberp group)
				(number-to-string group)
			      (symbol-name group)))
		(puthash (if prefix
			     (concat prefix group)
			     group)
			 (cons min max) hashtb))
	    (error (remhash group hashtb)))
	  (forward-line 1))))))