From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66834 Path: news.gmane.org!not-for-mail From: Justus-bulk@Piater.name Newsgroups: gmane.emacs.gnus.general Subject: Re: nnir.el swish++ interface broken Date: Thu, 17 Apr 2008 09:20:53 +0200 Message-ID: References: <87y77fiszu.fsf@ID-24456.user.uni-berlin.de> <87lk3fvw4l.fsf@ID-24456.user.uni-berlin.de> <873apmapq9.fsf_-_@ID-24456.user.uni-berlin.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1208416972 7199 80.91.229.12 (17 Apr 2008 07:22:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Apr 2008 07:22:52 +0000 (UTC) Cc: ding@gnus.org To: Christoph Conrad Original-X-From: ding-owner+M15316@lists.math.uh.edu Thu Apr 17 09:23:04 2008 connect(): Connection refused Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1JmOSW-0002zJ-FU for ding-account@gmane.org; Thu, 17 Apr 2008 09:23:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1JmOR4-0005XB-NC; Thu, 17 Apr 2008 02:21:34 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JmOR2-0005Wu-MF for ding@lists.math.uh.edu; Thu, 17 Apr 2008 02:21:32 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JmOQw-0006aa-9a for ding@lists.math.uh.edu; Thu, 17 Apr 2008 02:21:32 -0500 Original-Received: from serv108.segi.ulg.ac.be ([139.165.32.111]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JmOR6-0003ZP-00 for ; Thu, 17 Apr 2008 09:21:36 +0200 Original-Received: (qmail 23398 invoked from network); 17 Apr 2008 09:20:54 +0200 Original-Received: from unknown (HELO tool.montefiore.ulg.ac.be) (u193113@[139.165.11.16]) (envelope-sender ) by serv108.segi.ulg.ac.be (qmail-ldap-1.03) with SMTP for ; 17 Apr 2008 09:20:54 +0200 In-Reply-To: (Reiner Steib's message of "Wed, 16 Apr 2008 20:22:21 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) X-Spam-Score: -1.6 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66834 Archived-At: --=-=-= Content-Type: text/plain Reiner Steib 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=nnir.el.diff 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 --=-=-=--