From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66861 Path: news.gmane.org!not-for-mail From: Christoph Conrad Newsgroups: gmane.emacs.gnus.general Subject: Re: nnir.el cleanup Date: Tue, 22 Apr 2008 19:52:58 +0200 Message-ID: <87hcdtep8k.fsf@ID-24456.user.uni-berlin.de> 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> <87k5isa5vc.fsf@ID-24456.user.uni-berlin.de> Reply-To: Christoph Conrad NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1208887853 25154 80.91.229.12 (22 Apr 2008 18:10:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2008 18:10:53 +0000 (UTC) Cc: ding@gnus.org To: Justus@piater.name Original-X-From: ding-owner+M15343@lists.math.uh.edu Tue Apr 22 20:11:28 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 1JoMxd-0002UQ-TA for ding-account@gmane.org; Tue, 22 Apr 2008 20:11:22 +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 1JoMw1-00040s-EY; Tue, 22 Apr 2008 13:09:41 -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 1JoMvz-00040a-Mv for ding@lists.math.uh.edu; Tue, 22 Apr 2008 13:09:39 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JoMvs-0005VU-OL for ding@lists.math.uh.edu; Tue, 22 Apr 2008 13:09:39 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by quimby.gnus.org with smtp (Exim 3.35 #1 (Debian)) id 1JoMw3-0001fL-00 for ; Tue, 22 Apr 2008 20:09:43 +0200 Original-Received: (qmail invoked by alias); 22 Apr 2008 18:09:00 -0000 Original-Received: from p50891B90.dip0.t-ipconnect.de (EHLO brabbelbox) [80.137.27.144] by mail.gmx.net (mp056) with SMTP; 22 Apr 2008 20:09:00 +0200 X-Authenticated: #4523881 X-Provags-ID: V01U2FsdGVkX195+H4iy7l5YMCrMUapXQycX/7cxuew+EtsFcErML KZw8WzLRmFeHzH Original-Received: by brabbelbox (Postfix, from userid 1000) id 51E5EAC060; Tue, 22 Apr 2008 20:08:59 +0200 (CEST) X-Public-Key: http://wwwkeys.de.pgp.net:11371/pks/lookup?op=get&search=0x1B488DEA X-Now-Playing: Judee Sill - My Man On Love X-Hashcash: 1:20:080422:ding@gnus.org::5Exm8VK2acnEZaNE:00004tsh X-Hashcash: 1:20:080422:justus@piater.name::Y+SfTjDWylswjSGj:00000000000000000000000000000000000000000005coq User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 X-Y-GMX-Trusted: 0 X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66861 Archived-At: Hi Reiner, > I'm not sure that I understand what you have in mind. Could you > provide a patch that fixes/silences the Emacs 23 compiler warnings? See below. One warning remains, i don't understand why. In nnir-run-namazu: nnir.el:1475:28:Warning: reference to free variable `dirnam' nnir.el:1475:28:Warning: reference to free variable `artno' Possibly it has to do with the usage of nnir-add-result, a macro, but i don't understand why. Changelog entry proposal: Fixed byte compiler warnings, deleted unnecessary code. I also deleted superfluous settings of variables to nil in a let binding. I also see some suspicious and potentially dangerous code: the nnir-run-* functions not supporting the &optional group all define a local group variable in a let binding with default value nil which occlude the variable of the parameter list. This is IMHO unnecessary cause they throw an error at the beginning of the same function when the group parameter is not nil. With kind regards, Christoph =================================================================== RCS file: /usr/local/cvsroot/gnus/contrib/nnir.el,v retrieving revision 7.30 diff -u -b -B -w -d -r7.30 nnir.el --- nnir.el 21 Apr 2008 16:37:45 -0000 7.30 +++ nnir.el 22 Apr 2008 17:47:50 -0000 @@ -760,15 +760,8 @@ (deffoo nnir-retrieve-headers (articles &optional group server fetch-old) (save-excursion (let ((artlist (copy-sequence articles)) - (art nil) - (artitem nil) - (artgroup nil) (artno nil) - (artrsv nil) - (artfullgroup nil) - (novitem nil) - (novdata nil) - (foo nil) - server) + art artitem artgroup artno artrsv artfullgroup + novitem novdata foo server) (while (not (null artlist)) (setq art (car artlist)) (or (numberp art) @@ -822,7 +815,7 @@ (setq artlist (cdr artlist))) (setq novdata (nreverse novdata)) (set-buffer nntp-server-buffer) (erase-buffer) - (mapcar 'nnheader-insert-nov novdata) + (mapc 'nnheader-insert-nov novdata) 'nov))) (deffoo nnir-request-article (article @@ -879,9 +872,9 @@ ;; Set group to dirnam without any leading dots or slashes, ;; and with all subsequent slashes replaced by dots - (setq group (gnus-replace-in-string + (let ((group (gnus-replace-in-string (gnus-replace-in-string dirnam "^[./\\]" "" t) - "[/\\]" "." t)) + "[/\\]" "." t))) (vector (nnir-group-full-name group server) (if (string= server "nnmaildir:") @@ -889,7 +882,7 @@ (substring article 0 (string-match ":" article)) group nil) (string-to-number article)) - (string-to-number score)))) + (string-to-number score))))) ;;; Search Engine Interfaces: @@ -902,8 +895,7 @@ (save-excursion (let ((qstring (cdr (assq 'query query))) (prefix (nnir-read-server-parm 'nnir-wais-remove-prefix server)) - (artlist nil) - (score nil) (artno nil) (dirnam nil) (group nil)) + artlist score artno dirnam group) (set-buffer (get-buffer-create nnir-tmp-buffer)) (erase-buffer) (message "Doing WAIS query %s..." query) @@ -971,7 +963,7 @@ (let ((arts 0) (mbx (gnus-group-real-name group))) (when (imap-mailbox-select mbx nil buf) - (mapcar + (mapc (lambda (artnum) (push (vector group artnum 1) artlist) (setq arts (1+ arts))) @@ -1176,7 +1168,7 @@ (let ( (qstring (cdr (assq 'query query))) (groupspec (cdr (assq 'group query))) (prefix (nnir-read-server-parm 'nnir-swish++-remove-prefix server)) - (artlist nil) + artlist ;; nnml-use-compressed-files might be any string, but probably this ;; is sufficient. Note that we can't only use the value of ;; nnml-use-compressed-files because old articles might have been @@ -1184,7 +1176,7 @@ (article-pattern (if (string= server "nnmaildir:") ":[0-9]+" "^[0-9]+\\(\\.[a-z0-9]+\\)?$")) - (score nil) (artno nil) (dirnam nil) (group nil) ) + score artno dirnam group filenam ) (when (equal "" qstring) (error "swish++: You didn't enter anything.")) @@ -1266,8 +1258,7 @@ (prefix (or (nnir-read-server-parm 'nnir-swish-e-remove-prefix server) (error "Missing parameter `nnir-swish-e-remove-prefix'"))) - (artlist nil) - (score nil) (artno nil) (dirnam nil) (group nil) ) + artlist score artno dirnam group ) (when (equal "" qstring) (error "swish-e: You didn't enter anything.")) @@ -1431,18 +1422,13 @@ (when group (error "The Namazu backend cannot search specific groups")) (save-excursion - (let ( - (article-pattern (if (string= server "nnmaildir:") + (let ((article-pattern (if (string= server "nnmaildir:") ":[0-9]+" "^[0-9]+$")) - (artlist nil) - (qstring (cdr (assq 'query query))) + artlist (qstring (cdr (assq 'query query))) (prefix (nnir-read-server-parm 'nnir-namazu-remove-prefix server)) - (score nil) - (group nil) - (article nil) - (process-environment (copy-sequence process-environment)) - ) + score group article + (process-environment (copy-sequence process-environment))) (setenv "LC_MESSAGES" "C") (set-buffer (get-buffer-create nnir-tmp-buffer)) (erase-buffer) @@ -1672,7 +1658,7 @@ ;; from each artitem, extract group component (setq with-dups (mapcar 'nnir-artitem-group artlist)) ;; remove duplicates from above - (mapcar (function (lambda (x) (add-to-list 'res x))) + (mapc (function (lambda (x) (add-to-list 'res x))) with-dups) res))