Function: gnus-group-get-new-news-this-group

gnus-group-get-new-news-this-group is an interactive and byte-compiled function defined in gnus-group.el.gz.

Signature

(gnus-group-get-new-news-this-group &optional N DONT-SCAN)

Documentation

Check for newly arrived news in the current group (and the N-1 next groups).

The difference between N and the number of newsgroup checked is returned. If N is negative, this group and the N-1 previous groups will be checked. If DONT-SCAN is non-nil, scan non-activated groups as well.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-group.el.gz
(defun gnus-group-get-new-news-this-group (&optional n dont-scan)
  "Check for newly arrived news in the current group (and the N-1 next groups).
The difference between N and the number of newsgroup checked is returned.
If N is negative, this group and the N-1 previous groups will be checked.
If DONT-SCAN is non-nil, scan non-activated groups as well."
  (interactive "P" gnus-group-mode)
  (let* ((groups (gnus-group-process-prefix n))
	 (ret (if (numberp n) (- n (length groups)) 0))
	 (beg (unless n
		(point-marker)))
	 group method
	 (gnus-inhibit-demon t)
	 ;; Binding this variable will inhibit multiple fetchings
	 ;; of the same mail source.
	 (nnmail-fetched-sources (list t)))
    (gnus-run-hooks 'gnus-get-new-news-hook)
    (while (setq group (pop groups))
      (gnus-group-remove-mark group)
      ;; Bypass any previous denials from the server.
      (gnus-remove-denial (setq method (gnus-find-method-for-group group)))
      (if (if (and (not dont-scan)
		   ;; Prefer request-group-scan if the backend supports it.
		   (gnus-check-backend-function 'request-group-scan group))
	      (progn
		;; Ensure that the server is already open.
		(gnus-activate-group group nil nil method)
		(gnus-request-group-scan group (gnus-get-info group)))
	    (gnus-activate-group group (if dont-scan nil 'scan) nil method))
	  (let ((info (gnus-get-info group))
		(active (gnus-active group)))
	    (when info
              (gnus-request-update-info info method)
              (setq active (gnus-active group)))
	    (gnus-get-unread-articles-in-group info active)
	    (unless (gnus-virtual-group-p group)
	      (gnus-close-group group))
	    (when gnus-agent
	      (gnus-agent-save-group-info
	       method (gnus-group-real-name group) active))
	    (gnus-group-update-group group nil t))
	(gnus-error 3 "%s error: %s" group (gnus-status-message group))))
    (gnus-run-hooks 'gnus-after-getting-new-news-hook)
    (when beg
      (goto-char beg))
    (when gnus-goto-next-group-when-activating
      (gnus-group-next-unread-group 1 t))
    (gnus-group-position-point)
    ret))