Function: nnmaildir--prepare

nnmaildir--prepare is a byte-compiled function defined in nnmaildir.el.gz.

Signature

(nnmaildir--prepare SERVER GROUP)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmaildir.el.gz
;; Make the given server, if non-nil, be the current server.  Then make the
;; given group, if non-nil, be the current group of the current server.  Then
;; return the group object for the current group.
(defun nnmaildir--prepare (server group)
  (catch 'return
    (if (null server)
	(unless (setq server nnmaildir--cur-server)
	  (throw 'return nil))
      (unless (setq server (alist-get server nnmaildir--servers
				      nil nil #'equal))
	(throw 'return nil))
      (setq nnmaildir--cur-server server))
    (let ((groups (nnmaildir--srv-groups server)))
      (when (and groups (null (hash-table-empty-p groups)))
	(unless (nnmaildir--srv-method server)
	  (setf (nnmaildir--srv-method server)
		(or (gnus-server-to-method
		     (concat "nnmaildir:" (nnmaildir--srv-address server)))
		    (throw 'return nil))))
	(if (null group)
	    (nnmaildir--srv-curgrp server)
	  (gethash group groups))))))