Gnus development mailing list
 help / color / mirror / Atom feed
* patch for dynamic updates of the summary buffer while building
@ 2002-05-13 16:35 Wes Hardaker
  2002-05-14  1:45 ` Jesper Harder
  2003-01-01 19:31 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Wes Hardaker @ 2002-05-13 16:35 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 410 bytes --]


Ok, I got tired of watching the "Building summary buffer" message.  It
turns out (at least if you use threads), it's not to hard to see
something different.  This patch is not exactly perfectly thought out
and I'm not sure that it'll do strange things on some very customized
displays (but it works fine on my very customized display).

Now, the summary buffer is built dynamically and I can watch it
build.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 2451 bytes --]

Index: gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 6.207
diff -u -r6.207 gnus-sum.el
--- gnus-sum.el	2002/04/17 08:54:21	6.207
+++ gnus-sum.el	2002/05/13 16:43:56
@@ -4380,6 +4380,8 @@
   (let ((gnus-tmp-level 0)
 	(default-score (or gnus-summary-default-score 0))
 	(gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
+	(building-line-count gnus-summary-display-while-building)
+	(building-count (integerp gnus-summary-display-while-building))
 	thread number subject stack state gnus-tmp-gathered beg-match
 	new-roots gnus-tmp-new-adopts thread-end
 	gnus-tmp-header gnus-tmp-unread
@@ -4399,6 +4401,8 @@
 
       ;; Do the threaded display.
 
+      (if gnus-summary-display-while-building
+	  (switch-to-buffer (buffer-name)))
       (while (or threads stack gnus-tmp-new-adopts new-roots)
 
 	(if (and (= gnus-tmp-level 0)
@@ -4643,6 +4647,17 @@
 	(push (if (nth 1 thread) 1 0) tree-stack)
 	(incf gnus-tmp-level)
 	(setq threads (if thread-end nil (cdar thread)))
+	(if gnus-summary-display-while-building
+	    (if building-count
+		(progn
+		  ;; use a set frequency
+		  (setq building-line-count (1- building-line-count))
+		  (when (= building-line-count 0)
+		    (sit-for 0)
+		    (setq building-line-count
+			  gnus-summary-display-while-building)))
+	      ;; always
+	      (sit-for 0)))
 	(unless threads
 	  (setq gnus-tmp-level 0)))))
   (gnus-message 7 "Generating summary...done"))
@@ -4954,7 +4969,8 @@
 
 (defun gnus-articles-to-read (group &optional read-all)
   "Find out what articles the user wants to read."
-  (let* ((articles
+  (let* ((display (gnus-group-find-parameter group 'display))
+	 (articles
 	  ;; Select all articles if `read-all' is non-nil, or if there
 	  ;; are no unread articles.
 	  (if (or read-all
@@ -8587,6 +8603,15 @@
 If nil, use to the current newsgroup method."
   :type 'symbol
   :group 'gnus-summary-mail)
+
+(defcustom gnus-summary-display-while-building 5
+  "If not-nil, show and update the summary buffer as it's being built.
+If the value is t, update the buffer after every line is inserted.  If
+the value is an integer (N), update the display every N lines."
+  :group 'gnus-thread
+  :type '(choice (const :tag "off" nil)
+		 number
+		 (const :tag "frequently" t)))
 
 (defun gnus-summary-respool-article (&optional n method)
   "Respool the current article.

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]


-- 
"The trouble with having an open mind, of course, is that people will
 insist on coming along and trying to put things in it."   -- Terry Pratchett

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

* Re: patch for dynamic updates of the summary buffer while building
  2002-05-13 16:35 patch for dynamic updates of the summary buffer while building Wes Hardaker
@ 2002-05-14  1:45 ` Jesper Harder
  2002-05-14  2:05   ` Wes Hardaker
  2003-01-01 19:31 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Jesper Harder @ 2002-05-14  1:45 UTC (permalink / raw)


wes@hardakers.net (Wes Hardaker) writes:

> Ok, I got tired of watching the "Building summary buffer" message.  It
> turns out (at least if you use threads), it's not to hard to see
> something different.

Nice, I like it.  

It makes summary buffer generation 30-40% slower, though, so I'm sure it
should be turned on by default.

+
+(defcustom gnus-summary-display-while-building 5
+  "If not-nil, show and update the summary buffer as it's being built.
         ^
         n




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

* Re: patch for dynamic updates of the summary buffer while building
  2002-05-14  1:45 ` Jesper Harder
@ 2002-05-14  2:05   ` Wes Hardaker
  0 siblings, 0 replies; 4+ messages in thread
From: Wes Hardaker @ 2002-05-14  2:05 UTC (permalink / raw)
  Cc: ding

>>>>> On Tue, 14 May 2002 03:45:57 +0200, Jesper Harder <harder@ifa.au.dk> said:

Jesper> It makes summary buffer generation 30-40% slower, though, so
Jesper> I'm sure it should be turned on by default.

Yeah, you need to set the display update to something reasonable.  The
default of 5 is probably too small.  20 would probably be better.
I've thought, over the day, that maybe a percentage would be best.
IE, .05 would mean 5% and thus for really large groups wouldn't be
that frequent, but it wouldn't slow it down as much.

-- 
"The trouble with having an open mind, of course, is that people will
 insist on coming along and trying to put things in it."   -- Terry Pratchett



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

* Re: patch for dynamic updates of the summary buffer while building
  2002-05-13 16:35 patch for dynamic updates of the summary buffer while building Wes Hardaker
  2002-05-14  1:45 ` Jesper Harder
@ 2003-01-01 19:31 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-01 19:31 UTC (permalink / raw)


Wes Hardaker <wes@hardakers.net> writes:

> Ok, I got tired of watching the "Building summary buffer" message.  It
> turns out (at least if you use threads), it's not to hard to see
> something different.  This patch is not exactly perfectly thought out
> and I'm not sure that it'll do strange things on some very customized
> displays (but it works fine on my very customized display).
>
> Now, the summary buffer is built dynamically and I can watch it
> build.

Thanks for the patch; I've applied it to Oort Gnus v0.08 (i. e., CVS).

(I've defaulted `gnus-summary-display-while-building' to nil, though.)

Could you write some documentation for gnus.texi for this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

end of thread, other threads:[~2003-01-01 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-13 16:35 patch for dynamic updates of the summary buffer while building Wes Hardaker
2002-05-14  1:45 ` Jesper Harder
2002-05-14  2:05   ` Wes Hardaker
2003-01-01 19:31 ` 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).