Function: gnus-topic-goto-next-group

gnus-topic-goto-next-group is a byte-compiled function defined in gnus-topic.el.gz.

Signature

(gnus-topic-goto-next-group GROUP PROPS)

Documentation

Go to group or the next group after group.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-topic.el.gz
(defun gnus-topic-goto-next-group (group props)
  "Go to group or the next group after group."
  (if (not group)
      (if (not (memq 'gnus-topic props))
	  (goto-char (point-max))
	(let ((topic (cadr (memq 'gnus-topic props))))
	  (or (gnus-topic-goto-topic topic)
	      (gnus-topic-goto-topic (gnus-topic-next-topic topic)))))
    (if (gnus-group-goto-group group)
	t
      ;; The group is no longer visible.
      (let* ((list (assoc (gnus-group-topic group) gnus-topic-alist))
	     (topic-visible (save-excursion (gnus-topic-goto-topic (car list))))
	     (after (and topic-visible (cdr (member group (cdr list))))))
	;; First try to put point on a group after the current one.
	(while (and after
		    (not (gnus-group-goto-group (car after))))
	  (setq after (cdr after)))
	;; Then try to put point on a group before point.
	(unless after
	  (setq after (cdr (member group (reverse (cdr list)))))
	  (while (and after
		      (not (gnus-group-goto-group (car after))))
	    (setq after (cdr after))))
	;; Finally, just put point on the topic.
	(if (not (car list))
	    (goto-char (point-min))
	  (unless after
	    (if topic-visible
		(gnus-goto-char topic-visible)
	      (gnus-topic-goto-topic (gnus-topic-next-topic (car list))))
	    (setq after nil)))
	t))))