1 ;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Author: Ilja Weis <kult@uni-paderborn.de>
7 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
29 (eval-when-compile (require 'cl))
36 (defgroup gnus-topic nil
40 (defvar gnus-topic-mode nil
41 "Minor mode for Gnus group buffers.")
43 (defcustom gnus-topic-mode-hook nil
44 "Hook run in topic mode buffers."
48 (when (featurep 'xemacs)
49 (add-hook 'gnus-topic-mode-hook 'gnus-xmas-topic-menu-add))
51 (defcustom gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n"
52 "Format of topic lines.
53 It works along the same lines as a normal formatting string,
54 with some simple extensions.
56 %i Indentation based on topic level.
58 %v Nothing if the topic is visible, \"...\" otherwise.
59 %g Number of groups in the topic.
60 %a Number of unread articles in the groups in the topic.
61 %A Number of unread articles in the groups in the topic and its subtopics.
63 General format specifiers can also be used.
64 See Info node `(gnus)Formatting Variables'."
65 :link '(custom-manual "(gnus)Formatting Variables")
69 (defcustom gnus-topic-indent-level 2
70 "*How much each subtopic should be indented."
74 (defcustom gnus-topic-display-empty-topics t
75 "*If non-nil, display the topic lines even of topics that have no unread articles."
79 ;; Internal variables.
81 (defvar gnus-topic-active-topology nil)
82 (defvar gnus-topic-active-alist nil)
83 (defvar gnus-topic-unreads nil)
85 (defvar gnus-topology-checked-p nil
86 "Whether the topology has been checked in this session.")
88 (defvar gnus-topic-killed-topics nil)
89 (defvar gnus-topic-inhibit-change-level nil)
91 (defconst gnus-topic-line-format-alist