Gnus development mailing list
 help / color / mirror / Atom feed
* entering group hangs, `gnus-summary-hide-all-threads' loops forever
@ 2011-05-16 16:45 Ted Zlatanov
  2011-05-30 18:46 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2011-05-16 16:45 UTC (permalink / raw)
  To: ding

RET on a nnmaildir group hangs forever.  This is due to
`gnus-summary-hide-all-threads'.

This happens in only one group.  With the following modification, I can
see that it's doing millions of iterations in the loop, and there are
only a few articles in the group I'm entering.

(defun gnus-summary-hide-all-threads (&optional predicate)
  "Hide all thread subtrees.
If PREDICATE is supplied, threads that satisfy this predicate
will not be hidden."
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (let ((end nil)
          (count 0))
      (while (not end)
        (incf count)
        (when (zerop (mod count 1000))
          (message "Hiding all threads... %d" count))
	(when (or (not predicate)
		  (gnus-map-articles
		   predicate (gnus-summary-article-children)))
	    (gnus-summary-hide-thread))
	(setq end (not (zerop (gnus-summary-next-thread 1 t)))))))
  (gnus-summary-position-point))

Here's the backtrace with `toggle-debug-on-quit':

Debugger entered--Lisp error: (quit)
  gnus-summary-go-to-next-thread(nil)
  gnus-summary-next-thread(1 t)
  (zerop (gnus-summary-next-thread 1 t))
  (not (zerop (gnus-summary-next-thread 1 t)))
  (setq end (not (zerop (gnus-summary-next-thread 1 t))))
  (while (not end) (incf count) (when (zerop (mod count 100)) (message "Hiding all threads... %d" count)) (when (or (not predicate) (gnus-map-articles predicate (gnus-summary-article-children))) (gnus-summary-hide-thread)) (setq end (not (zerop (gnus-summary-next-thread 1 t)))))
  (let ((end nil) (count 0)) (while (not end) (incf count) (when (zerop (mod count 100)) (message "Hiding all threads... %d" count)) (when (or (not predicate) (gnus-map-articles predicate (gnus-summary-article-children))) (gnus-summary-hide-thread)) (setq end (not (zerop (gnus-summary-next-thread 1 t))))))
  (save-excursion (goto-char (point-min)) (let ((end nil) (count 0)) (while (not end) (incf count) (when (zerop (mod count 100)) (message "Hiding all threads... %d" count)) (when (or (not predicate) (gnus-map-articles predicate (gnus-summary-article-children))) (gnus-summary-hide-thread)) (setq end (not (zerop (gnus-summary-next-thread 1 t)))))))
  gnus-summary-hide-all-threads(nil)
  gnus-summary-maybe-hide-threads()
  gnus-summary-read-group-1("it" nil t nil nil nil)
  gnus-summary-read-group("it" nil t nil nil nil nil)
  gnus-group-read-group(nil t)
  gnus-group-select-group(nil)
  gnus-topic-select-group(nil)
  call-interactively(gnus-topic-select-group nil nil)

I won't touch this group to preserve the bug.  But the whole 
(not (zerop (next-thread))) logic is hard to understand, especially
since `gnus-summary-next-thread' does differential updates and is pretty
complicated.  So I need help to figure out where it's hanging.

Ted




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-31 18:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 16:45 entering group hangs, `gnus-summary-hide-all-threads' loops forever Ted Zlatanov
2011-05-30 18:46 ` Lars Magne Ingebrigtsen
2011-05-31  9:37   ` Ted Zlatanov
2011-05-31 18:50     ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).