🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87925

rmail-summary-goto-msg slow for large summaries

#87925
From: Marc Auslander
Date: Thu, 11 Aug 1994 21:29
55 lines
2651 bytes
In GNU Emacs 19.25.93.4 (rs6000-ibm-aix3.2.5) of Wed Aug 10 1994 on marc.watson.ibm.com

My earlier patch contained an unused variable "found" in the let
statement, residue of an earlier version of the code.  If you use this
change, please remove it, or use the updated patch which follows:


Marc Auslander   <marc@watson.ibm.com>   914 784-6699  (Tieline 863 Fax x6306)

*** lisp/rmailsum.el	Mon Aug  1 22:26:07 1994
--- rmailsum.el	Wed Aug 10 21:45:58 1994
***************
*** 768,773 ****
--- 768,791 ----
  
  (defvar rmail-summary-overlay nil)

+ (defun rmail-summary-find-msg (n)
+   (let ((start (point-min)) (diff (/(- (point-max) (point-min)) 2)))
+     (while (> diff 1000)
+       (setq start (+ start diff))
+       (goto-char start)
+       (beginning-of-line)
+       (skip-chars-forward " ")
+       (if (> (string-to-int (buffer-substring
+ 				     (point)
+ 				     (progn (skip-chars-forward "0-9")
+ 					    (point))))
+ 	     n)
+ 	  (setq start (- start diff)))
+       (setq diff (/ diff 2)))
+     (goto-char start)
+     (beginning-of-line)
+     (re-search-forward (concat "^ *" (int-to-string n)) nil t)))
+
  (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
    (interactive "P")
    (if (consp n) (setq n (prefix-numeric-value n)))
***************
*** 793,799 ****
  		 (goto-char (point-max))
  		 (rmail-summary-goto-msg)))
        (goto-char (point-min))
!       (if (not (re-search-forward (concat "^ *" (int-to-string n)) nil t))
  	  (progn (or nowarn (message "Message %d not found" n))
  		 (setq n curmsg)
  		 (setq message-not-found t)
--- 811,817 ----
  		 (goto-char (point-max))
  		 (rmail-summary-goto-msg)))
        (goto-char (point-min))
!       (if (not (rmail-summary-find-msg n))
  	  (progn (or nowarn (message "Message %d not found" n))
  		 (setq n curmsg)
  		 (setq message-not-found t)
Technical Details
Message-ID: <9408110206.AA29806@marc.watson.ibm.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!MathWorks.Com!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!watson.ibm.com!marc

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,2d74fbcc33233b79
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-12 18:52:18 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!MathWorks.Com!news.duke.edu!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!watson.ibm.com!marc
From: marc@watson.ibm.com (Marc Auslander)
Newsgroups: gnu.emacs.bug
Subject: rmail-summary-goto-msg slow for large summaries
Date: 11 Aug 1994 17:29:05 -0400
Organization: GNUs Not Usenet
Lines: 56
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408110206.AA29806@marc.watson.ibm.com>
Reply-To: marc@watson.ibm.com