Function: nnmairix-update-database

nnmairix-update-database is an interactive and byte-compiled function defined in nnmairix.el.gz.

Signature

(nnmairix-update-database &optional SERVERS)

Documentation

Call mairix for updating the database for SERVERS.

If SERVERS is nil, do update for all nnmairix servers. Mairix will be called asynchronously unless nnmairix-mairix-synchronous-update is t. Mairix will be called with nnmairix-mairix-update-options.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmairix.el.gz
(defun nnmairix-update-database (&optional servers)
  "Call mairix for updating the database for SERVERS.

If SERVERS is nil, do update for all nnmairix servers.  Mairix
will be called asynchronously unless
`nnmairix-mairix-synchronous-update' is t.  Mairix will be called
with `nnmairix-mairix-update-options'."
  (interactive)
  (let ((servers (or servers
		     (nnmairix-get-nnmairix-servers)))
	args cur commandsplit)
    (while servers
      (setq cur (car (pop servers)))
      (nnmairix-open-server
       (nth 1 (gnus-server-to-method cur)))
      (setq commandsplit (split-string nnmairix-mairix-command))
      (nnheader-message 7 "Updating mairix database for %s..." cur)
      (if nnmairix-mairix-synchronous-update
	  (progn
	    (setq args (append (list (car commandsplit) nil
				     (get-buffer nnmairix-mairix-output-buffer)
				     nil)))
	    (if (> (length commandsplit) 1)
		(setq args (append args (cdr commandsplit) nnmairix-mairix-update-options))
	      (setq args (append args nnmairix-mairix-update-options)))
	    (apply #'call-process args)
	    (nnheader-message 7 "Updating mairix database for %s... done" cur))
	(progn
	  (setq args (append (list cur (get-buffer nnmairix-mairix-output-buffer)
				   (car commandsplit))))
	  (if (> (length commandsplit) 1)
	      (setq args (append args (cdr commandsplit) nnmairix-mairix-update-options))
	    (setq args (append args nnmairix-mairix-update-options)))
	  (set-process-sentinel (apply #'start-process args)
				'nnmairix-sentinel-mairix-update-finished))))))