From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/18505 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE Newsgroups: gmane.emacs.gnus.general Subject: Storing the group a message has been written to Date: 11 Nov 1998 14:02:22 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035157017 6482 80.91.224.250 (20 Oct 2002 23:36:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:36:57 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id JAA29069 for ; Wed, 11 Nov 1998 09:31:56 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id IAB11231; Wed, 11 Nov 1998 08:31:47 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 11 Nov 1998 08:31:42 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [209.195.19.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id IAA07286 for ; Wed, 11 Nov 1998 08:31:29 -0600 (CST) Original-Received: from waldorf.cs.uni-dortmund.de (waldorf.cs.uni-dortmund.de [129.217.4.42]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id JAA29046 for ; Wed, 11 Nov 1998 09:31:14 -0500 (EST) Original-Received: from ramses.informatik.uni-dortmund.de (ramses.cs.uni-dortmund.de [129.217.20.180]) by waldorf.cs.uni-dortmund.de with SMTP id OAA17277 for ; Wed, 11 Nov 1998 14:02:23 +0100 (MET) Original-Received: (grossjoh@localhost) by ramses.informatik.uni-dortmund.de id OAA23063; Wed, 11 Nov 1998 14:02:23 +0100 Original-To: ding@gnus.org Original-Lines: 51 User-Agent: Gnus/5.070042 (Pterodactyl Gnus v0.42) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:18505 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:18505 Lars told me that I could add stuff to nnmail-cache-insert to store the group a message has been written to in ~/.nnmail-cache. I expect to be able to do useful stuff with it. I have now produced the following horrible abomination: ,----- | (defun nnmail-cache-insert (id) | (when nnmail-treat-duplicates | ;; Store some information about the group this message is written | ;; to. This function might have been called from various places. | ;; Sometimes, a function up in the calling sequence has an | ;; argument GROUP which is bound to a string, the group name. At | ;; other times, there is a function up in the calling sequence | ;; which has an argument GROUP-ART which is a list of pairs, and | ;; the car of a pair is a group name. Should we check that the | ;; length of the list is equal to 1? -- kai | (let ((g nil)) | (cond ((and (boundp 'group) group) | (setq g group)) | ((and (boundp 'group-art) group-art (listp group-art)) | (setq g (caar group-art))) | (t (setq g ""))) | (unless (gnus-buffer-live-p nnmail-cache-buffer) | (nnmail-cache-open)) | (save-excursion | (set-buffer nnmail-cache-buffer) | (goto-char (point-max)) | (insert id "\t" g "\n"))))) `----- This depends on the fact that nnmail-cache-insert is called (indirectly) from nnchoke-request-accept-article which sets GROUP-ART or from nnmail-split-incoming which sets GROUP. Two questions: (1) This is truly horrible, one should not depend on such an obfuscated fact. Any suggestions for improving this? (2) The group name is not unique. Sometimes the group name is `drafts' which comes from the nndraft server, sometimes the group name comes from the normal nnml server. I want to use this for mail splitting. Mail splitting deals with one backend only. Thus, I would need to find out whether the group concerned is from that backend and to ignore it if it doesn't come from the backend where mail splitting is done. kai -- Life is hard and then you die.