[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small bug in wl-summary.el?



At Sat, 16 Oct 2010 17:50:17 -0700,
Erik Hetzner wrote:
> 
> Hi,
> 
> I noticed that when opening folders WL sometimes spends a bit of time
> “Re-scanning...” Looking at the code, this didn’t seem to be right. I
> noticed that the function wl-summary-view-old-p sometimes returns true
> when perhaps it shouldn’t.
> 
> It seems that the variable wl-summary-buffer-number-list is sometimes
> set (at least in my buffers) to '(nil) (not plain old nil). (Perhaps
> this is because I sometimes interrupt opening a folder with C-g.) When
> the Summary buffer is empty and the value of
> wl-summary-buffer-number-list is '(nil), wl-summary-view-old-p will
> return t, necessitating a rescan when opening a buffer. Here is a
> modified version of wl-summary-view-old-p which checks for this
> situation.
> 
> Am I wrong to make this change? Any thoughts? Thank you!

Does the attached patch fix the problem? I should prevent the creation
of the wrong buffer-number-list in the first place.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de
diff --git a/wl/ChangeLog b/wl/ChangeLog
index 2786da9..63f7e1c 100644
--- a/wl/ChangeLog
+++ b/wl/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-17  David Maus  <dmaus@ictsoc.de>
+
+	* wl-summary.el (wl-summary-make-number-list): Handle quit
+	condition.
+
 2011-06-05  David Maus  <dmaus@ictsoc.de>
 
 	* wl-draft.el (wl-draft-save): Obtain number of appended draft
diff --git a/wl/wl-summary.el b/wl/wl-summary.el
index 8e833a9..49c3f76 100644
--- a/wl/wl-summary.el
+++ b/wl/wl-summary.el
@@ -2344,16 +2344,21 @@ If ARG, without confirm."
 	(get-buffer-create wl-summary-buffer-name))))
 
 (defun wl-summary-make-number-list ()
+  "Store list of visible messages' numbers in
+`wl-summary-buffer-number-list."
   (save-excursion
     (goto-char (point-min))
     (setq wl-summary-buffer-number-list nil)
-    (while (not (eobp))
-      (setq wl-summary-buffer-number-list
-	    (cons (wl-summary-message-number)
-		  wl-summary-buffer-number-list))
-      (forward-line 1))
-    (setq wl-summary-buffer-number-list
-	  (nreverse wl-summary-buffer-number-list))))
+    (condition-case nil
+	(progn
+	  (while (not (eobp))
+	    (setq wl-summary-buffer-number-list
+		  (cons (wl-summary-message-number)
+			wl-summary-buffer-number-list))
+	    (forward-line 1))
+	  (setq wl-summary-buffer-number-list
+		(nreverse wl-summary-buffer-number-list)))
+      (quit (setq wl-summary-buffer-number-list nil)))))
 
 (defun wl-summary-auto-select-msg-p (unread-msg)
   (and unread-msg

Attachment: pgpgepYOIqMvr.pgp
Description: PGP signature