Function: gnus-topic-mode

gnus-topic-mode is an autoloaded, interactive and byte-compiled function defined in gnus-topic.el.gz.

Signature

(gnus-topic-mode &optional ARG)

Documentation

Minor mode for topicsifying Gnus group buffers.

This is a minor mode. If called interactively, toggle the Gnus-Topic mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate gnus-topic-mode(var)/gnus-topic-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Probably introduced at or before Emacs version 19.32.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-topic.el.gz
(define-minor-mode gnus-topic-mode
  "Minor mode for topicsifying Gnus group buffers."
  :lighter " Topic"
  :keymap gnus-topic-mode-map
  :interactive (gnus-group-mode)
  (if (not (derived-mode-p 'gnus-group-mode))
      (setq gnus-topic-mode nil)
    ;; Infest Gnus with topics.
    (if (not gnus-topic-mode)
	(setq gnus-goto-missing-group-function nil)
      (when (gnus-visual-p 'topic-menu 'menu)
	(gnus-topic-make-menu-bar))
      (gnus-set-format 'topic t)
      (add-hook 'gnus-group-catchup-group-hook #'gnus-topic-update-topic)
      (setq-local gnus-group-prepare-function
                  #'gnus-group-prepare-topics)
      (setq-local gnus-group-get-parameter-function
                  #'gnus-group-topic-parameters)
      (setq-local gnus-group-goto-next-group-function
                  #'gnus-topic-goto-next-group)
      (setq-local gnus-group-indentation-function
                  #'gnus-topic-group-indentation)
      (setq-local gnus-group-update-group-function
                  #'gnus-topic-update-topics-containing-group)
      (setq-local gnus-group-sort-alist-function #'gnus-group-sort-topic)
      (setq gnus-group-change-level-function #'gnus-topic-change-level)
      (setq gnus-goto-missing-group-function #'gnus-topic-goto-missing-group)
      (add-hook 'gnus-check-bogus-groups-hook #'gnus-topic-clean-alist
		nil 'local)
      (setq gnus-topology-checked-p nil)
      ;; We check the topology.
      (when gnus-newsrc-alist
	(gnus-topic-check-topology)))
    ;; Remove topic infestation.
    (unless gnus-topic-mode
      (remove-hook 'gnus-summary-exit-hook #'gnus-topic-update-topic)
      (setq gnus-group-change-level-function nil)
      (remove-hook 'gnus-check-bogus-groups-hook #'gnus-topic-clean-alist)
      (setq gnus-group-prepare-function #'gnus-group-prepare-flat)
      (setq gnus-group-sort-alist-function #'gnus-group-sort-flat))
    (when (called-interactively-p 'any)
      (gnus-group-list-groups))))