* bug#7009: 24.0.50; [gnus] nnir uses incorrect server checks with maildir
@ 2010-09-10 15:18 Lluís
2010-09-30 21:47 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Lluís @ 2010-09-10 15:18 UTC (permalink / raw)
To: 7009; +Cc: rfrancoise
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
The `server' string is repeatedly checked against "nnmaildir:" to see if
the search result is stored in maildir.
Unfortunately, that string is, in fact "nnmaildir:somethingelse".
The attached patch makes sure that only the server type (i.e.,
"nnmaildir:") is checked.
[-- Attachment #2: nnir.el.patch --]
[-- Type: text/plain, Size: 2522 bytes --]
diff -Nur /tmp/nnir.el.orig /tmp/nnir.el
--- /tmp/nnir.el.orig 2010-09-10 17:03:51.000000000 +0200
+++ /tmp/nnir.el 2010-09-10 17:12:45.000000000 +0200
@@ -858,6 +858,12 @@
(nnoo-define-skeleton nnir)
+(defun nnir-server-type (server)
+ "Get the part until ':' from a server string."
+ (if (string-match "[^:]*:" server)
+ (substring server 0 (match-end 0))
+ server))
+
(defmacro nnir-add-result (dirnam artno score prefix server artlist)
"Ask `nnir-compose-result' to construct a result vector,
and if it is non-nil, add it to artlist."
@@ -880,7 +886,9 @@
(when (file-readable-p (concat prefix dirnam article))
;; remove trailing slash and, for nnmaildir, cur/new/tmp
(setq dirnam
- (substring dirnam 0 (if (string= server "nnmaildir:") -5 -1)))
+ (substring dirnam 0
+ (if (string= (nnir-server-type server) "nnmaildir:")
+ -5 -1)))
;; Set group to dirnam without any leading dots or slashes,
;; and with all subsequent slashes replaced by dots
@@ -889,7 +897,7 @@
"[/\\]" "." t)))
(vector (nnir-group-full-name group server)
- (if (string= server "nnmaildir:")
+ (if (string= (nnir-server-type server) "nnmaildir:")
(nnmaildir-base-name-to-article-number
(substring article 0 (string-match ":" article))
group nil)
@@ -1187,7 +1195,7 @@
;; is sufficient. Note that we can't only use the value of
;; nnml-use-compressed-files because old articles might have been
;; saved with a different value.
- (article-pattern (if (string= server "nnmaildir:")
+ (article-pattern (if (string= (nnir-server-type server) "nnmaildir:")
":[0-9]+"
"^[0-9]+\\(\\.[a-z0-9]+\\)?$"))
score artno dirnam filenam)
@@ -1437,12 +1445,12 @@
(when group
(error "The Namazu backend cannot search specific groups"))
(save-excursion
- (let ((article-pattern (if (string= server "nnmaildir:")
+ (let ((article-pattern (if (string= (nnir-server-type server) "nnmaildir:")
":[0-9]+"
"^[0-9]+$"))
artlist
- (qstring (cdr (assq 'query query)))
- (prefix (nnir-read-server-parm 'nnir-namazu-remove-prefix server))
+ (qstring (cdr (assq 'query query)))
+ (prefix (nnir-read-server-parm 'nnir-namazu-remove-prefix server))
score group article
(process-environment (copy-sequence process-environment)))
(setenv "LC_MESSAGES" "C")
Diff finished. Fri Sep 10 17:12:54 2010
[-- Attachment #3: Type: text/plain, Size: 1124 bytes --]
In GNU Emacs 24.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
of 2010-09-08 on elegiac, modified by Debian
(emacs-snapshot package, version 1:20100903-3)
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.50/site-lisp:/usr/share/emacs/site-lisp' '--without-compress-info' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''
apa!
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-30 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 15:18 bug#7009: 24.0.50; [gnus] nnir uses incorrect server checks with maildir Lluís
2010-09-30 21:47 ` Lars Magne Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.