X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-topic.el;h=3567f37aeb3c66cb70a727e683e73524cbc6e6ef;hb=873ba7b51ddfb07246cd874b7de72662308236c9;hp=17af1a3833334205b630922bd84b52bece43e575;hpb=f91b61597375d95fae71c558c67f3ec7e1f515eb;p=gnus diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index 17af1a383..3567f37ae 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -1,6 +1,6 @@ ;;; gnus-topic.el --- a folding minor mode for Gnus group buffers -;; Copyright (C) 1995-2011 Free Software Foundation, Inc. +;; Copyright (C) 1995-2012 Free Software Foundation, Inc. ;; Author: Ilja Weis ;; Lars Magne Ingebrigtsen @@ -145,13 +145,6 @@ See Info node `(gnus)Formatting Variables'." (setq alist (cdr alist))) out)) -(defun gnus-group-parent-topic (group) - "Return the topic GROUP is member of by looking at the group buffer." - (with-current-buffer gnus-group-buffer - (if (gnus-group-goto-group group) - (gnus-current-topic) - (gnus-group-topic group)))) - (defun gnus-topic-goto-topic (topic) (when topic (gnus-goto-char (text-property-any (point-min) (point-max) @@ -582,7 +575,7 @@ articles in the topic and its subtopics." (or gnus-topic-display-empty-topics ;We want empty topics (not (zerop unread)) ;Non-empty tick ;Ticked articles - (/= point-max (point-max)))) ;Unactivated groups + (/= point-max (point-max)))) ;Inactive groups (gnus-extent-start-open (point)) (gnus-topic-insert-topic-line (car type) visiblep @@ -969,12 +962,15 @@ articles in the topic and its subtopics." (if (not group) (if (not (memq 'gnus-topic props)) (goto-char (point-max)) - (gnus-topic-goto-topic (symbol-name (cadr (memq 'gnus-topic props))))) + (let ((topic (symbol-name (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)) - (after (cdr (member group (cdr list))))) + (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)))) @@ -989,7 +985,9 @@ articles in the topic and its subtopics." (if (not (car list)) (goto-char (point-min)) (unless after - (gnus-topic-goto-topic (car list)) + (if topic-visible + (gnus-goto-char topic-visible) + (gnus-topic-goto-topic (gnus-topic-next-topic (car list)))) (setq after nil))) t)))) @@ -1297,6 +1295,8 @@ When used interactively, PARENT will be the topic under point." ;; 2. Can't process on several marked groups with a same name, ;; because gnus-group-marked only keeps one copy. +(defvar gnus-topic-history nil) + (defun gnus-topic-move-group (n topic &optional copyp) "Move the next N groups to TOPIC. If COPYP, copy the groups instead."