From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/11791 Path: main.gmane.org!not-for-mail From: roth@klondike.cse.ucsc.edu (Carl D. Roth) Newsgroups: gmane.emacs.gnus.general Subject: Re: BUG: NoCeM and foreign groups: does it work? Date: 25 Jul 1997 12:33:22 -0700 Organization: University of California, Santa Cruz Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Fri_Jul_25_12:33:21_1997-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035151446 32550 80.91.224.250 (20 Oct 2002 22:04:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:04:06 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.6/8.8.6) with ESMTP id NAA09977 for ; Fri, 25 Jul 1997 13:19:09 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id PAA13035 for ; Fri, 25 Jul 1997 15:15:28 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Fri, 25 Jul 1997 21:35:06 +0200 Original-Received: (qmail 15665 invoked by uid 504); 25 Jul 1997 19:35:05 -0000 Original-Received: (qmail 15662 invoked from network); 25 Jul 1997 19:35:04 -0000 Original-Received: from sunsite.auc.dk (qmailr@130.225.51.30) by claymore.vcinet.com with SMTP; 25 Jul 1997 19:35:04 -0000 Original-Received: (qmail 11087 invoked by uid 509); 25 Jul 1997 19:35:01 -0000 Original-To: ding@gnus.org Original-Newsgroups: emacs.ding Original-Lines: 88 X-Newsreader: Gnus v5.4.64/XEmacs 19.15 Original-Path: klondike.cse.ucsc.edu Original-NNTP-Posting-Host: klondike.cse.ucsc.edu Xref: main.gmane.org gmane.emacs.gnus.general:11791 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:11791 --Multipart_Fri_Jul_25_12:33:21_1997-1 Content-Type: text/plain; charset=US-ASCII Lars Magne Ingebrigtsen writes: > roth@cse.ucsc.edu (Carl D. Roth) writes: > > The way I've worked around points 1. and 3. above is to slightly > > modify gnus-nocem-enter-article to match groups out of a *different* > > hashtb than gnus-newsrc-hashtb. This new hash table consists of the > > gnus-group-real-name mappings of all of the groups in the newsrc. > Yes, that sounds like the right way to do it. Could you mail me > patches? I hope posting is OK... The patch itself also adds a debugging statement to nocem-check-article. I run nocem in batch mode, and I want to know about all of the `invalid' nocem issuers. --Multipart_Fri_Jul_25_12:33:21_1997-1 Content-Type: text/plain; name=".signature"; charset=US-ASCII Carl Roth mailto:roth@cse.ucsc.edu (finger for PGP public key) --Multipart_Fri_Jul_25_12:33:21_1997-1 Content-Type: application/octet-stream; name="gnus-nocem.diff"; type=patch Content-Disposition: attachment; filename="gnus-nocem.diff" Content-Transfer-Encoding: 7bit --- gnus-nocem.el.orig Fri Jul 25 12:25:51 1997 +++ gnus-nocem.el Fri Jul 25 12:29:06 1997 @@ -96,6 +96,24 @@ (defun gnus-nocem-cache-file () (concat (file-name-as-directory gnus-nocem-directory) "cache")) +;; +;; faster lookups for group names: +;; + +(defvar gnus-real-group-hashtb nil + "Real-name mappings of subscribed groups.") + +(defun gnus-fill-real-hashtb () + "Fill up a hash table with the real-name mappings from the user's +active file." + (setq gnus-real-group-hashtb (gnus-make-hashtable 123)) + (mapcar '(lambda (group) + (setq group (gnus-group-real-name (car group))) + (gnus-sethash group + t + gnus-real-group-hashtb)) + gnus-newsrc-alist)) + (defun gnus-nocem-scan-groups () "Scan all NoCeM groups for new NoCeM messages." (interactive) @@ -105,6 +123,8 @@ (gnus-make-directory gnus-nocem-directory) ;; Load any previous NoCeM headers. (gnus-nocem-load-cache) + ;; Get the group name mappings: + (gnus-fill-real-hashtb) ;; Read the active file if it hasn't been read yet. (and (file-exists-p (gnus-nocem-active-file)) (not gnus-nocem-active) @@ -185,6 +205,8 @@ (narrow-to-region b e) (setq issuer (mail-fetch-field "issuer")) (widen) + (or (member issuer gnus-nocem-issuers) + (message "invalid NoCeM issuer: %s" issuer)) (and (member issuer gnus-nocem-issuers) ; We like her.... (gnus-nocem-verify-issuer issuer) ; She is who she says she is... (gnus-nocem-enter-article) ; We gobble the message.. @@ -223,7 +245,7 @@ (set group nil)) (t (when (gnus-gethash (gnus-group-real-name (symbol-name group)) - gnus-newsrc-hashtb) + gnus-real-group-hashtb) ;; Valid group. (beginning-of-line) (while (= (following-char) ?\t) --Multipart_Fri_Jul_25_12:33:21_1997-1--