comparison lisp/gnus/gnus-topic.el @ 151:59463afc5666 r20-3b2

Import from CVS: tag r20-3b2
author cvs
date Mon, 13 Aug 2007 09:37:19 +0200
parents 318232e2a3f0
children 43dd3413c7c7
comparison
equal deleted inserted replaced
150:8ebb1c0f0f6f 151:59463afc5666
75 (defvar gnus-topology-checked-p nil 75 (defvar gnus-topology-checked-p nil
76 "Whether the topology has been checked in this session.") 76 "Whether the topology has been checked in this session.")
77 77
78 (defvar gnus-topic-killed-topics nil) 78 (defvar gnus-topic-killed-topics nil)
79 (defvar gnus-topic-inhibit-change-level nil) 79 (defvar gnus-topic-inhibit-change-level nil)
80 (defvar gnus-topic-tallied-groups nil)
81 80
82 (defconst gnus-topic-line-format-alist 81 (defconst gnus-topic-line-format-alist
83 `((?n name ?s) 82 `((?n name ?s)
84 (?v visible ?s) 83 (?v visible ?s)
85 (?i indentation ?s) 84 (?i indentation ?s)
359 If ALL is non-nil, list groups that have no unread articles. 358 If ALL is non-nil, list groups that have no unread articles.
360 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher." 359 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher."
361 (set-buffer gnus-group-buffer) 360 (set-buffer gnus-group-buffer)
362 (let ((buffer-read-only nil) 361 (let ((buffer-read-only nil)
363 (lowest (or lowest 1))) 362 (lowest (or lowest 1)))
364
365 (setq gnus-topic-tallied-groups nil)
366 363
367 (when (or (not gnus-topic-alist) 364 (when (or (not gnus-topic-alist)
368 (not gnus-topology-checked-p)) 365 (not gnus-topology-checked-p))
369 (gnus-topic-check-topology)) 366 (gnus-topic-check-topology))
370 367
437 (gnus-group-insert-group-line 434 (gnus-group-insert-group-line
438 (gnus-info-group info) 435 (gnus-info-group info)
439 (gnus-info-level info) (gnus-info-marks info) 436 (gnus-info-level info) (gnus-info-marks info)
440 (car entry) (gnus-info-method info))))) 437 (car entry) (gnus-info-method info)))))
441 (when (and (listp entry) 438 (when (and (listp entry)
442 (numberp (car entry)) 439 (numberp (car entry)))
443 (not (member (gnus-info-group (setq info (nth 2 entry)))
444 gnus-topic-tallied-groups)))
445 (push (gnus-info-group info) gnus-topic-tallied-groups)
446 (incf unread (car entry))) 440 (incf unread (car entry)))
447 (when (listp entry) 441 (when (listp entry)
448 (setq tick t))) 442 (setq tick t)))
449 (goto-char beg) 443 (goto-char beg)
450 ;; Insert the topic line. 444 ;; Insert the topic line.
646 640
647 (defun gnus-topic-close () 641 (defun gnus-topic-close ()
648 (setq gnus-topic-active-topology nil 642 (setq gnus-topic-active-topology nil
649 gnus-topic-active-alist nil 643 gnus-topic-active-alist nil
650 gnus-topic-killed-topics nil 644 gnus-topic-killed-topics nil
651 gnus-topic-tallied-groups nil
652 gnus-topology-checked-p nil)) 645 gnus-topology-checked-p nil))
653 646
654 (defun gnus-topic-check-topology () 647 (defun gnus-topic-check-topology ()
655 ;; The first time we set the topology to whatever we have 648 ;; The first time we set the topology to whatever we have
656 ;; gotten here, which can be rather random. 649 ;; gotten here, which can be rather random.
898 "M" gnus-topic-move-matching 891 "M" gnus-topic-move-matching
899 "C" gnus-topic-copy-matching 892 "C" gnus-topic-copy-matching
900 "\C-i" gnus-topic-indent 893 "\C-i" gnus-topic-indent
901 [tab] gnus-topic-indent 894 [tab] gnus-topic-indent
902 "r" gnus-topic-rename 895 "r" gnus-topic-rename
903 "\177" gnus-topic-delete) 896 "\177" gnus-topic-delete
897 "h" gnus-topic-toggle-display-empty-topics)
904 898
905 (gnus-define-keys (gnus-topic-sort-map "S" gnus-group-topic-map) 899 (gnus-define-keys (gnus-topic-sort-map "S" gnus-group-topic-map)
906 "s" gnus-topic-sort-groups 900 "s" gnus-topic-sort-groups
907 "a" gnus-topic-sort-groups-by-alphabet 901 "a" gnus-topic-sort-groups-by-alphabet
908 "u" gnus-topic-sort-groups-by-unread 902 "u" gnus-topic-sort-groups-by-unread
928 ["Hide" gnus-topic-hide-topic t] 922 ["Hide" gnus-topic-hide-topic t]
929 ["Delete" gnus-topic-delete t] 923 ["Delete" gnus-topic-delete t]
930 ["Rename" gnus-topic-rename t] 924 ["Rename" gnus-topic-rename t]
931 ["Create" gnus-topic-create-topic t] 925 ["Create" gnus-topic-create-topic t]
932 ["Mark" gnus-topic-mark-topic t] 926 ["Mark" gnus-topic-mark-topic t]
933 ["Indent" gnus-topic-indent t]) 927 ["Indent" gnus-topic-indent t]
928 ["Toggle hide empty" gnus-topic-toggle-display-empty-topics t])
934 ["List active" gnus-topic-list-active t])))) 929 ["List active" gnus-topic-list-active t]))))
935 930
936 (defun gnus-topic-mode (&optional arg redisplay) 931 (defun gnus-topic-mode (&optional arg redisplay)
937 "Minor mode for topicsifying Gnus group buffers." 932 "Minor mode for topicsifying Gnus group buffers."
938 (interactive (list current-prefix-arg t)) 933 (interactive (list current-prefix-arg t))
1303 (let ((gnus-topic-topology gnus-topic-active-topology) 1298 (let ((gnus-topic-topology gnus-topic-active-topology)
1304 (gnus-topic-alist gnus-topic-active-alist) 1299 (gnus-topic-alist gnus-topic-active-alist)
1305 gnus-killed-list gnus-zombie-list) 1300 gnus-killed-list gnus-zombie-list)
1306 (gnus-group-list-groups 9 nil 1))) 1301 (gnus-group-list-groups 9 nil 1)))
1307 1302
1303 (defun gnus-topic-toggle-display-empty-topics ()
1304 "Show/hide topics that have no unread articles."
1305 (interactive)
1306 (setq gnus-topic-display-empty-topics
1307 (not gnus-topic-display-empty-topics))
1308 (message "%s empty topics"
1309 (if gnus-topic-display-empty-topics
1310 "Showing" "Hiding")))
1311
1308 ;;; Topic sorting functions 1312 ;;; Topic sorting functions
1309 1313
1310 (defun gnus-topic-edit-parameters (group) 1314 (defun gnus-topic-edit-parameters (group)
1311 "Edit the group parameters of GROUP. 1315 "Edit the group parameters of GROUP.
1312 If performed on a topic, edit the topic parameters instead." 1316 If performed on a topic, edit the topic parameters instead."