Function: nnmh-request-group

nnmh-request-group is a byte-compiled function defined in nnmh.el.gz.

Signature

(nnmh-request-group GROUP &optional SERVER DONT-CHECK INFO)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmh.el.gz
(deffoo nnmh-request-group (group &optional server dont-check _info)
  (nnheader-init-server-buffer)
  (nnmh-possibly-change-directory group server)
  (let ((pathname (nnmail-group-pathname group nnmh-directory))
	(file-name-coding-system nnmail-pathname-coding-system)
	dir)
    (cond
     ((not (file-directory-p pathname))
      (nnheader-report
       'nnmh "Can't select group (no such directory): %s" group))
     (t
      (setq nnmh-current-directory pathname)
      (and nnmh-get-new-mail
	   nnmh-be-safe
	   (nnmh-update-gnus-unreads group))
      (cond
       (dont-check
	(nnheader-report 'nnmh "Selected group %s" group)
	t)
       (t
	;; Re-scan the directory if it's on a foreign system.
	(nnheader-re-read-dir pathname)
	(setq dir
	      (sort
	       (mapcar #'string-to-number
		       (directory-files pathname nil "\\`[0-9]+\\'" t))
	       #'<))
	(cond
	 (dir
	  (setq nnmh-group-alist
		(delq (assoc group nnmh-group-alist) nnmh-group-alist))
	  (push (list group (cons (car dir) (car (last dir))))
		nnmh-group-alist)
	  (nnheader-report 'nnmh "Selected group %s" group)
	  (nnheader-insert
	   "211 %d %d %d %s\n" (length dir) (car dir)
	   (car (last dir)) group))
	 (t
	  (nnheader-report 'nnmh "Empty group %s" group)
	  (nnheader-insert (format "211 0 1 0 %s\n" group))))))))))