Function: gnus-group-update-group

gnus-group-update-group is an autoloaded and byte-compiled function defined in gnus-group.el.gz.

Signature

(gnus-group-update-group GROUP &optional VISIBLE-ONLY INFO-UNCHANGED)

Documentation

Update all lines where GROUP appear.

If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-group.el.gz
(defun gnus-group-update-group (group &optional visible-only
				      info-unchanged)
  "Update all lines where GROUP appear.
If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't
already.  If INFO-UNCHANGED is non-nil, dribble buffer is not updated."
  (with-current-buffer gnus-group-buffer
    (save-excursion
      ;; The buffer may be narrowed.
      (save-restriction
        (widen)
        (let (found buffer-read-only)
	  (unless info-unchanged
	    ;; Enter the current status into the dribble buffer.
	    (let ((entry (gnus-group-entry group)))
	      (when (and entry
			 (not (gnus-ephemeral-group-p group)))
		(gnus-dribble-enter
		 (concat "(gnus-group-set-info '"
			 (gnus-prin1-to-string (nth 1 entry))
			 ")")
		 (concat "^(gnus-group-set-info '(\""
			 (regexp-quote group) "\"")))))
          ;; Find all group instances.  If topics are in use, groups
          ;; may be listed more than once.
	  (goto-char (point-min))
          (while (gnus-text-property-search
                  'gnus-group group 'forward 'goto)
            (setq found t)
            (let ((gnus-group-indentation (gnus-group-group-indentation)))
              (gnus-delete-line)
              (gnus-group-insert-group-line-info group)
              (save-excursion
                (forward-line -1)
                (gnus-run-hooks 'gnus-group-update-group-hook))))
          (unless (or found visible-only)
            ;; No such line in the buffer, find out where it's supposed to
            ;; go, and insert it there (or at the end of the buffer).
            (if gnus-goto-missing-group-function
                (funcall gnus-goto-missing-group-function group)
              (let ((entry (cdr (member group gnus-group-list))))
		(goto-char (point-min))
                (while (and (car-safe entry)
                            (not
                             (gnus-text-property-search
                              'gnus-group (car entry) 'forward 'goto)))
                  (setq entry (cdr entry)))
                (or entry (goto-char (point-max)))))
            ;; Finally insert the line.
            (let ((gnus-group-indentation (gnus-group-group-indentation)))
              (gnus-group-insert-group-line-info group)
              (save-excursion
                (forward-line -1)
                (gnus-run-hooks 'gnus-group-update-group-hook))))
          (when gnus-group-update-group-function
            (funcall gnus-group-update-group-function group))
          (gnus-group-set-mode-line))))))