comparison lisp/gnus/gnus-sum.el @ 90718:f1d13e615070

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 523-544) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 168-171) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-150
author Miles Bader <miles@gnu.org>
date Thu, 07 Dec 2006 04:14:14 +0000
parents dbe3f29e61d6 e03278254fa9
children 6588c6259dfb
comparison
equal deleted inserted replaced
90717:06937e972ad0 90718:f1d13e615070
13 ;; the Free Software Foundation; either version 2, or (at your option) 13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version. 14 ;; any later version.
15 15
16 ;; GNU Emacs is distributed in the hope that it will be useful, 16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details. 19 ;; GNU General Public License for more details.
20 20
21 ;; You should have received a copy of the GNU General Public License 21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
108 If this variable is `dummy', Gnus will create a dummy root that will 108 If this variable is `dummy', Gnus will create a dummy root that will
109 have all the sub-threads as children. 109 have all the sub-threads as children.
110 If this variable is `adopt', Gnus will make one of the \"children\" 110 If this variable is `adopt', Gnus will make one of the \"children\"
111 the parent and mark all the step-children as such. 111 the parent and mark all the step-children as such.
112 If this variable is `empty', the \"children\" are printed with empty 112 If this variable is `empty', the \"children\" are printed with empty
113 subject fields. (Or rather, they will be printed with a string 113 subject fields. (Or rather, they will be printed with a string
114 given by the `gnus-summary-same-subject' variable.)" 114 given by the `gnus-summary-same-subject' variable.)"
115 :group 'gnus-thread 115 :group 'gnus-thread
116 :type '(choice (const :tag "off" nil) 116 :type '(choice (const :tag "off" nil)
117 (const none) 117 (const none)
118 (const dummy) 118 (const dummy)
3973 ;; Push all the subthreads onto the stack. 3973 ;; Push all the subthreads onto the stack.
3974 (push (cdr thread) stack))) 3974 (push (cdr thread) stack)))
3975 infloop)) 3975 infloop))
3976 3976
3977 (defun gnus-make-threads () 3977 (defun gnus-make-threads ()
3978 "Go through the dependency hashtb and find the roots. Return all threads." 3978 "Go through the dependency hashtb and find the roots. Return all threads."
3979 (let (threads) 3979 (let (threads)
3980 (while (catch 'infloop 3980 (while (catch 'infloop
3981 (mapatoms 3981 (mapatoms
3982 (lambda (refs) 3982 (lambda (refs)
3983 ;; Deal with self-referencing References loops. 3983 ;; Deal with self-referencing References loops.
4479 "Remove the thread that has ID in it." 4479 "Remove the thread that has ID in it."
4480 (let (headers thread last-id) 4480 (let (headers thread last-id)
4481 ;; First go up in this thread until we find the root. 4481 ;; First go up in this thread until we find the root.
4482 (setq last-id (gnus-root-id id) 4482 (setq last-id (gnus-root-id id)
4483 headers (message-flatten-list (gnus-id-to-thread last-id))) 4483 headers (message-flatten-list (gnus-id-to-thread last-id)))
4484 ;; We have now found the real root of this thread. It might have 4484 ;; We have now found the real root of this thread. It might have
4485 ;; been gathered into some loose thread, so we have to search 4485 ;; been gathered into some loose thread, so we have to search
4486 ;; through the threads to find the thread we wanted. 4486 ;; through the threads to find the thread we wanted.
4487 (let ((threads gnus-newsgroup-threads) 4487 (let ((threads gnus-newsgroup-threads)
4488 sub) 4488 sub)
4489 (while threads 4489 (while threads
4559 (defun gnus-sort-threads (threads) 4559 (defun gnus-sort-threads (threads)
4560 "Sort THREADS." 4560 "Sort THREADS."
4561 (if (not gnus-thread-sort-functions) 4561 (if (not gnus-thread-sort-functions)
4562 threads 4562 threads
4563 (gnus-message 8 "Sorting threads...") 4563 (gnus-message 8 "Sorting threads...")
4564 (let ((max-lisp-eval-depth 5000)) 4564 (let ((max-lisp-eval-depth (max 5000 max-lisp-eval-depth)))
4565 (prog1 (gnus-sort-threads-1 4565 (prog1 (gnus-sort-threads-1
4566 threads 4566 threads
4567 (gnus-make-sort-function gnus-thread-sort-functions)) 4567 (gnus-make-sort-function gnus-thread-sort-functions))
4568 (gnus-message 8 "Sorting threads...done"))))) 4568 (gnus-message 8 "Sorting threads...done")))))
4569 4569
5925 (ietf-drums-unfold-fws) 5925 (ietf-drums-unfold-fws)
5926 (gnus-run-hooks 'gnus-parse-headers-hook) 5926 (gnus-run-hooks 'gnus-parse-headers-hook)
5927 (let ((case-fold-search t) 5927 (let ((case-fold-search t)
5928 in-reply-to header p lines chars) 5928 in-reply-to header p lines chars)
5929 (goto-char (point-min)) 5929 (goto-char (point-min))
5930 ;; Search to the beginning of the next header. Error messages 5930 ;; Search to the beginning of the next header. Error messages
5931 ;; do not begin with 2 or 3. 5931 ;; do not begin with 2 or 3.
5932 (while (re-search-forward "^[23][0-9]+ " nil t) 5932 (while (re-search-forward "^[23][0-9]+ " nil t)
5933 (setq id nil 5933 (setq id nil
5934 ref nil) 5934 ref nil)
5935 ;; This implementation of this function, with nine 5935 ;; This implementation of this function, with nine
5936 ;; search-forwards instead of the one re-search-forward and 5936 ;; search-forwards instead of the one re-search-forward and
5937 ;; a case (which basically was the old function) is actually 5937 ;; a case (which basically was the old function) is actually
5938 ;; about twice as fast, even though it looks messier. You 5938 ;; about twice as fast, even though it looks messier. You
5939 ;; can't have everything, I guess. Speed and elegance 5939 ;; can't have everything, I guess. Speed and elegance
5940 ;; doesn't always go hand in hand. 5940 ;; doesn't always go hand in hand.
5941 (setq 5941 (setq
5942 header 5942 header
5943 (vector 5943 (vector
8163 ;; First we get the number of visible children to this thread. This 8163 ;; First we get the number of visible children to this thread. This
8164 ;; is done by recursing down the thread using this function, so this 8164 ;; is done by recursing down the thread using this function, so this
8165 ;; will really go down to a leaf article first, before slowly 8165 ;; will really go down to a leaf article first, before slowly
8166 ;; working its way up towards the root. 8166 ;; working its way up towards the root.
8167 (when thread 8167 (when thread
8168 (let* ((max-lisp-eval-depth 5000) 8168 (let* ((max-lisp-eval-depth (max 5000 max-lisp-eval-depth))
8169 (children 8169 (children
8170 (if (cdr thread) 8170 (if (cdr thread)
8171 (apply '+ (mapcar 'gnus-summary-limit-children 8171 (apply '+ (mapcar 'gnus-summary-limit-children
8172 (cdr thread))) 8172 (cdr thread)))
8173 0)) 8173 0))