Gnus development mailing list
 help / color / mirror / Atom feed
* nnmairix and huge search results
@ 2008-01-28 14:24 Tassilo Horn
  2008-01-28 19:49 ` David
  0 siblings, 1 reply; 3+ messages in thread
From: Tassilo Horn @ 2008-01-28 14:24 UTC (permalink / raw)
  To: ding

Hi,

I use nnmairix with my local mail groups and I really enjoy it.  But I
have one issue.  Whenever a search yields many results and I have a
search group with thousand or more messages and try to enter it with RET
and selecting to display all (or at least many) messages I get an error:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("[ 	]zz_mairix-searches-1:[0-9]+" " searches:57788" nil t t)
  (setq xref (replace-regexp-in-string (format "[ 	]%s:[0-9]+" backendgroup) (format " %s:%d" mairixgroup article) (mail-header-xref cur) t t))
  (progn (setq cur (nnheader-parse-nov)) (when corr (setq article ...) (mail-header-set-number cur article)) (setq xref (replace-regexp-in-string ... ... ... t t)) (mail-header-set-xref cur xref) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) (when (not ...) (forward-line 1)))
  (if (or (looking-at ...) (nnheader-find-nov-line article)) (progn (setq cur ...) (when corr ... ...) (setq xref ...) (mail-header-set-xref cur xref) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) (when ... ...)))
  (when (or (looking-at ...) (nnheader-find-nov-line article)) (setq cur (nnheader-parse-nov)) (when corr (setq article ...) (mail-header-set-number cur article)) (setq xref (replace-regexp-in-string ... ... ... t t)) (mail-header-set-xref cur xref) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) (when (not ...) (forward-line 1)))
  (lambda (article) (when (or ... ...) (setq cur ...) (when corr ... ...) (setq xref ...) (mail-header-set-xref cur xref) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) (when ... ...)))(1768)
  mapcar((lambda (article) (when (or ... ...) (setq cur ...) (when corr ... ...) (setq xref ...) (mail-header-set-xref cur xref) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) (when ... ...))) (210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 ...))
  (save-excursion (set-buffer buf) (erase-buffer) (set-buffer nntp-server-buffer) (goto-char (point-min)) (nnheader-message 7 "nnmairix: Rewriting headers...") (mapcar (function ...) articles) (nnheader-message 7 "nnmairix: Rewriting headers... done") (kill-buffer nntp-server-buffer) (set-buffer buf) (rename-buffer name) (setq nntp-server-buffer buf))
  (let ((buf ...) (corr ...) (name ...) header cur xref) (save-excursion (set-buffer buf) (erase-buffer) (set-buffer nntp-server-buffer) (goto-char ...) (nnheader-message 7 "nnmairix: Rewriting headers...") (mapcar ... articles) (nnheader-message 7 "nnmairix: Rewriting headers... done") (kill-buffer nntp-server-buffer) (set-buffer buf) (rename-buffer name) (setq nntp-server-buffer buf)))
  nnmairix-replace-group-and-numbers((210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 ...) "zz_mairix-searches-1" "searches" 56020)
  (progn (nnmairix-replace-group-and-numbers articles folder group numcorr) rval)
  (if (eq rval (quote nov)) (progn (nnmairix-replace-group-and-numbers articles folder group numcorr) rval))
  (when (eq rval (quote nov)) (nnmairix-replace-group-and-numbers articles folder group numcorr) rval)
  (let* ((folder ...) (corr ...) (numcorr 0) rval) (when (and corr ... ...) (setq numcorr ...) (setq articles ...)) (setq rval (nnmairix-call-backend "retrieve-headers" articles folder nnmairix-backend-server fetch-old)) (when (eq rval ...) (nnmairix-replace-group-and-numbers articles folder group numcorr) rval))
  nnmairix-retrieve-headers((56230 56231 56232 56233 56234 56235 56236 56237 56238 56239 56240 56241 56242 56243 56244 56245 56246 56247 56248 56249 56250 56251 56252 56253 56254 56255 56256 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56272 56273 56274 56275 56276 56277 56278 56279 ...) "searches" "MairixServer" some)
  gnus-retrieve-headers((56230 56231 56232 56233 56234 56235 56236 56237 56238 56239 56240 56241 56242 56243 56244 56245 56246 56247 56248 56249 56250 56251 56252 56253 56254 56255 56256 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56272 56273 56274 56275 56276 56277 56278 56279 ...) "nnmairix+MairixServer:searches" some)
  gnus-cache-retrieve-headers((56230 56231 56232 56233 56234 56235 56236 56237 56238 56239 56240 56241 56242 56243 56244 56245 56246 56247 56248 56249 56250 56251 56252 56253 56254 56255 56256 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56272 56273 56274 56275 56276 56277 56278 56279 ...) "nnmairix+MairixServer:searches" some)
  gnus-retrieve-headers((56230 56231 56232 56233 56234 56235 56236 56237 56238 56239 56240 56241 56242 56243 56244 56245 56246 56247 56248 56249 56250 56251 56252 56253 56254 56255 56256 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56272 56273 56274 56275 56276 56277 56278 56279 ...) "nnmairix+MairixServer:searches" some)
  gnus-fetch-headers((56230 56231 56232 56233 56234 56235 56236 56237 56238 56239 56240 56241 56242 56243 56244 56245 56246 56247 56248 56249 56250 56251 56252 56253 56254 56255 56256 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56272 56273 56274 56275 56276 56277 56278 56279 ...))
  gnus-select-newsgroup("nnmairix+MairixServer:searches" nil nil)
  gnus-summary-read-group-1("nnmairix+MairixServer:searches" nil t nil nil nil)
  gnus-summary-read-group("nnmairix+MairixServer:searches" 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)

With my current search group, which contains 1966 messages, it works if
I select only to see at most 407 articles.  With 408 or above I get the
error above.

Bye,
Tassilo



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

* Re: nnmairix and huge search results
  2008-01-28 14:24 nnmairix and huge search results Tassilo Horn
@ 2008-01-28 19:49 ` David
  2008-01-28 20:15   ` Tassilo Horn
  0 siblings, 1 reply; 3+ messages in thread
From: David @ 2008-01-28 19:49 UTC (permalink / raw)
  To: ding

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

Tassilo Horn <tassilo@member.fsf.org> writes:
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   replace-regexp-in-string("[ 	]zz_mairix-searches-1:[0-9]+" " searches:57788" nil t t)

Thanks for the backtrace. The code stumbled upon a message with no Xref
header. I wouldn't know why this happens for many search results - seems
more like a coincidence. Anyway, please apply the attached patch to a
current nnmairix.el (v0.4) and tell me if it fixes the problem.

-David


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

--- ../nnmairix_0.4.el	2008-01-28 20:36:23.000000000 +0100
+++ nnmairix.el	2008-01-28 20:30:56.000000000 +0100
@@ -1025,10 +1025,10 @@
 	    (when corr
 		  (setq article (+ (mail-header-number cur) numc))
 		  (mail-header-set-number cur article))
-	    (setq xref (replace-regexp-in-string
-			(format "[ \t]%s:[0-9]+" backendgroup)
-			(format " %s:%d" mairixgroup article)
-			(mail-header-xref cur) t t))
+	    (setq xref (mail-header-xref cur))
+	    (when (and (stringp xref)
+		       (string-match (format "[ \t]%s:[0-9]+" backendgroup) xref))
+	      (setq xref (replace-match (format " %s:%d" mairixgroup article) t nil xref)))
 	    (mail-header-set-xref cur xref)
 	    (set-buffer buf)
 	    (nnheader-insert-nov cur)

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

* Re: nnmairix and huge search results
  2008-01-28 19:49 ` David
@ 2008-01-28 20:15   ` Tassilo Horn
  0 siblings, 0 replies; 3+ messages in thread
From: Tassilo Horn @ 2008-01-28 20:15 UTC (permalink / raw)
  To: ding

David <de_bb@arcor.de> writes:

Hi David,

> Tassilo Horn <tassilo@member.fsf.org> writes:
>> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>>   replace-regexp-in-string("[ 	]zz_mairix-searches-1:[0-9]+" " searches:57788" nil t t)
>
> Thanks for the backtrace. The code stumbled upon a message with no
> Xref header. I wouldn't know why this happens for many search results
> - seems more like a coincidence.

Indeed, but of course $Messagecount is proportional to P(the bad one is
included).

> Anyway, please apply the attached patch to a current nnmairix.el
> (v0.4) and tell me if it fixes the problem.

Yes, now it works like a charm.  Thanks a lot!

Bye,
Tassilo



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

end of thread, other threads:[~2008-01-28 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 14:24 nnmairix and huge search results Tassilo Horn
2008-01-28 19:49 ` David
2008-01-28 20:15   ` Tassilo Horn

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).