From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/33469 Path: main.gmane.org!not-for-mail From: janneke@gnu.org Newsgroups: gmane.emacs.gnus.general Subject: Re: how does expiry-target work? Date: 22 Nov 2000 13:57:19 +0100 Organization: Jan at Appel Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035169569 25309 80.91.224.250 (21 Oct 2002 03:06:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:06:09 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 7580AD049A for ; Wed, 22 Nov 2000 07:58:10 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id GAB03297; Wed, 22 Nov 2000 06:58:02 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 22 Nov 2000 06:57:08 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id GAA27751 for ; Wed, 22 Nov 2000 06:56:57 -0600 (CST) Original-Received: from appel.lilypond.org (node1600a.a2000.nl [24.132.96.10]) by mailhost.sclp.com (Postfix) with ESMTP id A3791D049A for ; Wed, 22 Nov 2000 07:57:21 -0500 (EST) Original-Received: (from fred@localhost) by appel.lilypond.org (8.9.3/8.9.3) id NAA06269; Wed, 22 Nov 2000 13:57:19 +0100 X-Authentication-Warning: appel.lilypond.org: fred set sender to janneke@gnu.org using -f Original-To: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "21 Nov 2000 16:57:18 +0100" Original-Lines: 77 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:33469 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:33469 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) writes: > Maybe expiry-target is only implemented for nnml groups. I'm not sure. Ah, that's it. You can see from my comments that I haven't really grasped the finer details of Gnus, but here's a start that seems to work. It may need some cleaning, possibly by someone who knows the answer to my comments. Greetings, Jan. --- nnmh.el.orig Wed Nov 22 11:31:40 2000 +++ nnmh.el Wed Nov 22 13:50:37 2000 @@ -53,6 +53,14 @@ articles in this folder. The articles that are \"new\" will be marked as unread by Gnus.") =20 +;; ugh -- why does user need to know what mail backend she has? +(defcustom nnmh-expiry-target 'delete + "*Variable that says where expired messages should end up." + :group 'nnmh-expire + :type '(choice (const delete) + (function :format "%v" nnmh-) + string)) + =20 (defconst nnmh-version "nnmh 1.0" @@ -248,10 +256,28 @@ (deffoo nnmh-request-newgroups (date &optional server) (nnmh-request-list server)) =20 +;; Do we need this? We can't seem to use nnmail-expiry-target-group. +;; What exacty is generic, and what's backend (nnmail, nnml, nnheader)? +;; -- jcn +(defun nnmh-expiry-target-group (target group) + (when (nnheader-functionp target) + (setq target (funcall target group))) + (unless (eq target 'delete) + (gnus-request-accept-article target))) + +;; Urg, there's lots of code duplication and not much doco in backends +;; group =3D nnmh:inbox.foo +;; newsgroup =3D inbox.foo =3D=3D (gnus-group-real-name group) +;; -- jcn (deffoo nnmh-request-expire-articles (articles newsgroup &optional server force) (nnmh-possibly-change-directory newsgroup server) (let* ((is-old t) + ;; gnus-group::gnus-group-expire-articles-1 only checks for + ;; nnmail backend + (nnmh-expiry-target + (or (gnus-group-find-parameter group 'expiry-target) + nnmh-expiry-target)) article rest mod-time) (nnheader-init-server-buffer) =20 @@ -263,6 +289,13 @@ (setq is-old (nnmail-expired-article-p newsgroup mod-time force))) (progn + ;; Allow a special target group. -- jcn + (unless (eq nnmh-expiry-target 'delete) + (with-temp-buffer + (nnmh-request-article (car articles) + newsgroup server (current-buffer)) + (nnmh-expiry-target-group + nnmh-expiry-target group))) (nnheader-message 5 "Deleting article %s in %s..." article newsgroup) (condition-case () --=20 Jan Nieuwenhuizen | GNU LilyPond - The music typesetter http://www.xs4all.nl/~jantien | http://www.lilypond.org