Function: gnus-find-new-newsgroups

gnus-find-new-newsgroups is an interactive and byte-compiled function defined in gnus-start.el.gz.

Signature

(gnus-find-new-newsgroups &optional ARG)

Documentation

Search for new newsgroups and add them.

Each new newsgroup will be treated with gnus-subscribe-newsgroup-method. The -n option line from .newsrc is respected.

With 1 C-u (universal-argument), use the ask-server method to query the server for new groups. With 2 C-u (universal-argument)'s, use most complete method possible to query the server for new groups, and subscribe the new groups as zombies.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-start.el.gz
(defun gnus-find-new-newsgroups (&optional arg)
  "Search for new newsgroups and add them.
Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method'.
The `-n' option line from .newsrc is respected.

With 1 \\[universal-argument], use the `ask-server' method to query the server for new
groups.
With 2 \\[universal-argument]'s, use most complete method possible to query the server
for new groups, and subscribe the new groups as zombies."
  (interactive "p" gnus-group-mode)
  (let* ((gnus-subscribe-newsgroup-method
	  gnus-subscribe-newsgroup-method)
	 (check (cond
		 ((or (and (= (or arg 1) 4)
			   (not (listp gnus-check-new-newsgroups)))
		      (null gnus-read-active-file)
		      (eq gnus-read-active-file 'some))
		  'ask-server)
		 ((= (or arg 1) 16)
		  (setq gnus-subscribe-newsgroup-method
			'gnus-subscribe-zombies)
		  t)
		 (t gnus-check-new-newsgroups))))
    (if (or (consp check)
            (eq check 'ask-server))
        ;; Ask the server for new groups.
        (gnus-ask-server-for-new-groups)
      ;; Go through the active hashtb and look for new groups.
      (let ((groups 0)
            new-newsgroups)
        (gnus-message 5 "Looking for new newsgroups...")
        (unless gnus-have-read-active-file
          (gnus-read-active-file))
        (setq gnus-newsrc-last-checked-date (message-make-date))
        (unless gnus-killed-hashtb
          (gnus-make-hashtable-from-killed))
        ;; Go though every newsgroup in `gnus-active-hashtb' and compare
        ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'.
        (maphash
         (lambda (g-name _active)
           (unless (or (gethash g-name gnus-killed-hashtb)
                       (gethash g-name gnus-newsrc-hashtb))
             (let ((do-sub (gnus-matches-options-n g-name)))
               (cond
                ((eq do-sub 'subscribe)
                 (setq groups (1+ groups))
                 (puthash g-name t gnus-killed-hashtb)
                 (gnus-call-subscribe-functions
                  gnus-subscribe-options-newsgroup-method g-name))
                ((eq do-sub 'ignore)
                 nil)
                (t
                 (setq groups (1+ groups))
                 (puthash g-name t gnus-killed-hashtb)
                 (if gnus-subscribe-hierarchical-interactive
                     (push g-name new-newsgroups)
                   (gnus-call-subscribe-functions
                    gnus-subscribe-newsgroup-method g-name)))))))
         gnus-active-hashtb)
        (when new-newsgroups
          (gnus-subscribe-hierarchical-interactive new-newsgroups))
        (if (> groups 0)
            (gnus-message 5 "%d new newsgroup%s arrived."
                          groups (if (> groups 1) "s have" " has"))
          (gnus-message 5 "No new newsgroups."))
	groups))))