Gnus development mailing list
 help / color / mirror / Atom feed
From: Justus-bulk@Piater.name
To: Christoph Conrad <christoph.conrad@gmx.de>
Cc: ding@gnus.org
Subject: Re: nnir.el swish++ interface broken
Date: Thu, 17 Apr 2008 09:20:53 +0200	[thread overview]
Message-ID: <x8t8wzdlzfu.fsf@tool.montefiore.ulg.ac.be> (raw)
In-Reply-To: <v9y77dwtgi.fsf_-_@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Wed, 16 Apr 2008 20:22:21 +0200")

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

Reiner Steib <reinersteib+gmane@imap.cc> wrote on Wed, 16 Apr 2008
20:22:21 +0200:

> On Wed, Apr 16 2008, Christoph Conrad wrote:
>
>>> The result is at http://www.montefiore.ulg.ac.be/~piater/test/nnir.el
>>> and works for me. Christoph, can you test it?
>
> This isn't based on the current CVS version.  Could you please provide
> a diff against current CVS?

Attached. I also updated the complete file on my Web server.

Justus



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnir.el.diff --]
[-- Type: text/x-diff, Size: 4401 bytes --]

Index: nnir.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/contrib/nnir.el,v
retrieving revision 7.26
diff -c -r7.26 nnir.el
*** nnir.el	15 Apr 2008 21:16:28 -0000	7.26
--- nnir.el	17 Apr 2008 07:19:38 -0000
***************
*** 859,864 ****
--- 859,872 ----
  (nnoo-define-skeleton nnir)
  
  
+ (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."
+   `(let ((result (nnir-compose-result dirnam artno score prefix server)))
+      (when (not (null result))
+        (push result artlist))))
+ 
+ 
  ;; Helper function currently used by the Swish++ and Namazu backends;
  ;; perhaps useful for other backends as well
  (defun nnir-compose-result (dirnam article score prefix server)
***************
*** 869,889 ****
    (when (string-match (concat "^" prefix) dirnam)
      (setq dirnam (replace-match "" t t dirnam)))
  
!   ;; remove trailing slash and, for nnmaildir, cur/new/tmp
!   (setq dirnam (substring dirnam 0 (if (string= server "nnmaildir:") -5 -1)))
! 
!   ;; eliminate all ".", "/", "\" from beginning. Always matches.
!   (string-match "^[./\\]*\\(.*\\)$" dirnam)
!   (setq group (substitute ?. ?/ (match-string 1 dirnam))) ;; "/" -> "."
!   (setq group (substitute ?. ?\\ group)) ;; "\\" -> "."
! 
!   (vector (nnir-group-full-name group server)
! 	  (if (string= server "nnmaildir:")
! 	      (nnmaildir-base-name-to-article-number
! 	       (substring article 0 (string-match ":" article))
! 	       group nil)
! 	    (string-to-int article))
! 	  (string-to-int score)))
  
  
  ;;; Search Engine Interfaces:
--- 877,900 ----
    (when (string-match (concat "^" prefix) dirnam)
      (setq dirnam (replace-match "" t t dirnam)))
  
!   (if (not (file-readable-p (concat prefix dirnam article)))
!       nil
!     ;; remove trailing slash and, for nnmaildir, cur/new/tmp
!     (setq dirnam
! 	  (substring dirnam 0 (if (string= server "nnmaildir:") -5 -1)))
! 
!     ;; eliminate all ".", "/", "\" from beginning. Always matches.
!     (string-match "^[./\\]*\\(.*\\)$" dirnam)
!     (setq group (substitute ?. ?/ (match-string 1 dirnam))) ;; "/" -> "."
!     (setq group (substitute ?. ?\\ group)) ;; "\\" -> "."
! 
!     (vector (nnir-group-full-name group server)
! 	    (if (string= server "nnmaildir:")
! 		(nnmaildir-base-name-to-article-number
! 		 (substring article 0 (string-match ":" article))
! 		 group nil)
! 	      (string-to-int article))
! 	    (string-to-int score))))
  
  
  ;;; Search Engine Interfaces:
***************
*** 1223,1238 ****
                artno (file-name-nondirectory filenam)
                dirnam (file-name-directory filenam))
  
!         ;; don't match directories or inexistent/unreadable files
!         (when (and (string-match article-pattern artno)
! 		   (file-readable-p (concat prefix filenam)))
            (when (not (null dirnam))
  
  	    ;; maybe limit results to matching groups.
  	    (when (or (not groupspec)
  		      (string-match groupspec dirnam))
! 	      (push (nnir-compose-result dirnam artno score prefix server)
! 		    artlist)))))
  
        (message "Massaging swish++ output...done")
  
--- 1234,1247 ----
                artno (file-name-nondirectory filenam)
                dirnam (file-name-directory filenam))
  
!         ;; don't match directories
!         (when (string-match article-pattern artno)
            (when (not (null dirnam))
  
  	    ;; maybe limit results to matching groups.
  	    (when (or (not groupspec)
  		      (string-match groupspec dirnam))
! 	      (nnir-add-result dirnam artno score prefix server artlist)))))
  
        (message "Massaging swish++ output...done")
  
***************
*** 1480,1487 ****
          ;; make sure article and group is sane
          (when (and (string-match article-pattern article)
                     (not (null group)))
! 	  (push (nnir-compose-result group article score prefix server)
! 		artlist)))
  
        ;; sort artlist by score
        (apply 'vector
--- 1489,1495 ----
          ;; make sure article and group is sane
          (when (and (string-match article-pattern article)
                     (not (null group)))
! 	  (nnir-add-result group article score prefix server artlist)))
  
        ;; sort artlist by score
        (apply 'vector

  reply	other threads:[~2008-04-17  7:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y77fiszu.fsf@ID-24456.user.uni-berlin.de>
     [not found] ` <87lk3fvw4l.fsf@ID-24456.user.uni-berlin.de>
2008-04-15 21:21   ` Reiner Steib
     [not found]   ` <873apmapq9.fsf_-_@ID-24456.user.uni-berlin.de>
     [not found]     ` <x8tfxtm2mqc.fsf@tool.montefiore.ulg.ac.be>
2008-04-16 10:50       ` FIX Christoph Conrad
2008-04-16 18:22         ` nnir.el swish++ interface broken (was: FIX) Reiner Steib
2008-04-17  7:20           ` Justus-bulk [this message]
2008-04-17  7:37             ` nnir.el swish++ interface broken Christoph Conrad
2008-04-17 18:01               ` Christoph Conrad
2008-04-19 17:36             ` Reiner Steib
2008-04-20  7:48               ` nnir.el cleanup (was Re: nnir.el swish++ interface broken) Justus
2008-04-20 10:09                 ` nnir.el cleanup Reiner Steib
2008-04-20 15:39                   ` Christoph Conrad
2008-04-20 20:02                     ` Reiner Steib
2008-04-22 17:52                       ` Christoph Conrad
2008-04-24 18:06                         ` Reiner Steib
2008-04-24 18:34                           ` Christoph Conrad
2008-04-24 18:17                         ` Compiler warnings in nnir.el (was: nnir.el cleanup) Reiner Steib
2008-04-25  2:27                           ` Compiler warnings in nnir.el Stefan Monnier
2008-04-20 11:03                 ` nnir.el cleanup (was Re: nnir.el swish++ interface broken) Christoph Conrad
2008-04-21 13:40                 ` Christoph Conrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x8t8wzdlzfu.fsf@tool.montefiore.ulg.ac.be \
    --to=justus-bulk@piater.name \
    --cc=christoph.conrad@gmx.de \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).