Gnus development mailing list
 help / color / mirror / Atom feed
* how does expiry-target work?
@ 2000-11-21 15:37 janneke
  2000-11-21 15:57 ` Kai Großjohann
  2000-11-22  3:37 ` Harry Putnam
  0 siblings, 2 replies; 10+ messages in thread
From: janneke @ 2000-11-21 15:37 UTC (permalink / raw)


Hi,

I'm still trying to migrate from nmh to Gnus, and it seems that today
I found the killer feature replacement for my ``refile-read'' and
refile-replied'' scripts: expiration and expiry-targets should
be able to move mail automatically from my inbox to my archive, right?

However, I can't get expiratation to move my mail, it only *removes*.

This is what I tried, I made a copy of my inbox (named ``indoos''),
and created a test-archive where to move expired mail, with one
message in it:

   cp -prv ~/mh/indoos ~/mh/indoos/copy
   mkdir ~/mh/indoos/expired
   cp ~/mh/indoos/1 ~/mh/indoos/expired

In Gnus (v5.8.7) I subscribed to both new mail groups:

    nnmh:indoos.copy  
    nnmh:indoos.expired

and then edited the group parameters for the inbox-copy (G p from
*Group*):

    ;;; Editing the group parameters for `nnmh:indoos.copy'.
    ;; Type `C-c C-c' after you've finished editing.

    ((auto-expire . t)
     (total-expire . t) 
     (expiry-wait . 0) 
     (expiry-target . "nnmh:indoos.expired"))

typed C-c C-c, exited Gnus, emacs, restarted.

When I enter nnmh:indoos.copy and read two messages 9 and 10, they're
marked ``E''.  I press ``B e M-g'' and they're gone.

On the disk, only 9 is removed (be sure to keep 1?) from
~/mh/indoos/copy, but it hasn't shown up in ~/mh/indoos/expired.

Are you all using this feature, and how?

Oh, and another two small related things: I would like to expire
automatically only mail that I replied to, from my inbox, would that
make sense and be possible?  Also, it seems that Gnus doesn't annotate
the messages when I reply, but uses a somewhat more (too?) volatile
way of keeping track.  For some reason I'm quite often loosing the
``replied'' flag on certain messages between sessions; maybe because
my ssh session gets interrupted?

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-11-21 15:37 how does expiry-target work? janneke
@ 2000-11-21 15:57 ` Kai Großjohann
  2000-11-22 12:57   ` janneke
  2000-12-06 15:25   ` Jan Nieuwenhuizen
  2000-11-22  3:37 ` Harry Putnam
  1 sibling, 2 replies; 10+ messages in thread
From: Kai Großjohann @ 2000-11-21 15:57 UTC (permalink / raw)
  Cc: ding

Maybe expiry-target is only implemented for nnml groups.  I'm not sure.
kai
-- 
The arms should be held in a natural and unaffected way and never
be conspicuous. -- Revised Technique of Latin American Dancing



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-11-21 15:37 how does expiry-target work? janneke
  2000-11-21 15:57 ` Kai Großjohann
@ 2000-11-22  3:37 ` Harry Putnam
  1 sibling, 0 replies; 10+ messages in thread
From: Harry Putnam @ 2000-11-22  3:37 UTC (permalink / raw)


janneke@gnu.org writes:

>     ((auto-expire . t)
>      (total-expire . t) 
>      (expiry-wait . 0) 
>      (expiry-target . "nnmh:indoos.expired"))

Can one have both auto-expire and total-expire in one group? 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-11-21 15:57 ` Kai Großjohann
@ 2000-11-22 12:57   ` janneke
  2000-11-22 22:11     ` ShengHuo ZHU
  2000-12-06 15:25   ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 10+ messages in thread
From: janneke @ 2000-11-22 12:57 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) 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.")
 
+;; 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))
+
 \f
 
 (defconst nnmh-version "nnmh 1.0"
@@ -248,10 +256,28 @@
 (deffoo nnmh-request-newgroups (date &optional server)
   (nnmh-request-list server))
 
+;; 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 = nnmh:inbox.foo
+;; newsgroup = inbox.foo   == (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)
 
@@ -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 ()


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-11-22 12:57   ` janneke
@ 2000-11-22 22:11     ` ShengHuo ZHU
  0 siblings, 0 replies; 10+ messages in thread
From: ShengHuo ZHU @ 2000-11-22 22:11 UTC (permalink / raw)


janneke@gnu.org writes:

> 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.

[...]

> +;; 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

We can use nnmail-expiry-target-group. nnml is a backend. nnmail and
nnheader are mail support functions for Gnus backends.


[...]

> @@ -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 ()

I guess we only need this part after replacing nnmh with nnmail.

ShengHuo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-11-21 15:57 ` Kai Großjohann
  2000-11-22 12:57   ` janneke
@ 2000-12-06 15:25   ` Jan Nieuwenhuizen
  2000-12-09  3:13     ` Kai Großjohann
  1 sibling, 1 reply; 10+ messages in thread
From: Jan Nieuwenhuizen @ 2000-12-06 15:25 UTC (permalink / raw)
  Cc: ding

On Tuesday, 21 November 2000, Kai =?iso-8859-1?q?Gro=DFjohann?= writes:

> Maybe expiry-target is only implemented for nnml groups.  I'm not sure.

Ok, so first I implemented expiry-target for nnmh and am trying that.
However, it seems that total-expire doesn't wait for expiry-wait?  In
any case, it make a mess of the chonological order of the archive.

Then I tried using nnml, hoping that expiry-wait and expiry-target
work well there, but it seems that nnml doesn't work together with 
fetchail/slocal?

I can't give up mh yet, because I use ``pick'' a lot for finding
articles (-from foo -and -search bar).  Immediate scoring doesn't seem
to work (just no effect), and using temporary scoring is a bit clumsy
for just finding one mail...

Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-12-06 15:25   ` Jan Nieuwenhuizen
@ 2000-12-09  3:13     ` Kai Großjohann
  2000-12-09 13:00       ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Großjohann @ 2000-12-09  3:13 UTC (permalink / raw)
  Cc: ding

On Wed, 06 Dec 2000, Jan Nieuwenhuizen wrote:

> I can't give up mh yet, because I use ``pick'' a lot for finding
> articles (-from foo -and -search bar).  Immediate scoring doesn't
> seem to work (just no effect), and using temporary scoring is a bit
> clumsy for just finding one mail...

Why does using pick require that you use nnmh and not nnml?  Reading
nnml groups works just fine using the MH tools, but you have to be
extremely careful not to modify the ~/Mail directory in any way.

Do you think a search engine backend for nnir.el would be useful that
uses pick?

kai
-- 
The arms should be held in a natural and unaffected way and never
be conspicuous. -- Revised Technique of Latin American Dancing



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-12-09  3:13     ` Kai Großjohann
@ 2000-12-09 13:00       ` Jan Nieuwenhuizen
  2000-12-10 16:09         ` Kai Großjohann
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Nieuwenhuizen @ 2000-12-09 13:00 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Why does using pick require that you use nnmh and not nnml?  Reading
> nnml groups works just fine using the MH tools, but you have to be
> extremely careful not to modify the ~/Mail directory in any way.

Ah, of course!  And, what if I do modify the ~/Mail directory by
accident, or as a variation on that question, how can I convert my
nnmh groups to nnml?  I guess that nnml is one of *the* backends to
use, right?

Btw, I fixed a bug in my expiry-target patch for nnmh.  I've been
using it now for a few days, and it seems to work fine.  Maybe you(?)
want to include it in Gnus?

> Do you think a search engine backend for nnir.el would be useful that
> uses pick?

    13:41:35 appel ~$ locate nnir.el
    13:41:39 appel ~$ 

As you can see, I'll have to look at nnir.el first, google will
probably help me.  But, I've always found pick to be very effective,
(and didn't get immediate scoring to work.  will look at nnir) it is
one of the two last nmh features I still use.

The other one is not really an nmh feature: I've written a crude
script ``rpatch' that reads the current message, tries various unpack
methods to find the patch, find a sensible name if none is specified,
eg (<package>-<version>.<emailadrress>.diff.gz>) patches, save and
possibly apply it (to LilyPond).  Maybe you happen to have some lisp
code that does parts of that?

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-12-09 13:00       ` Jan Nieuwenhuizen
@ 2000-12-10 16:09         ` Kai Großjohann
  2000-12-15 17:32           ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Großjohann @ 2000-12-10 16:09 UTC (permalink / raw)
  Cc: ding

On 09 Dec 2000, Jan Nieuwenhuizen wrote:
> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> 
>> Why does using pick require that you use nnmh and not nnml?
>> Reading nnml groups works just fine using the MH tools, but you
>> have to be extremely careful not to modify the ~/Mail directory in
>> any way.
> 
> Ah, of course!  And, what if I do modify the ~/Mail directory by
> accident,

Then you must be careful to rebuild the information that Gnus has.
For example, if you delete a message, the corresponding .overview
entry needs to be deleted, too, as well as the entry in .newsrc.eld.
And possibly the active file needs to be adjusted.

As you can see, don't modify the ~/Mail directory outside of Gnus.
Gnus will get very angry at you.

> or as a variation on that question, how can I convert my nnmh groups
> to nnml?  I guess that nnml is one of *the* backends to use, right?

The generic way to do this would be to copy the old groups someplace
safe, then create new nnml groups.  Copy each old group to the new
group by opening the file with `G f' or the directory with `G D' (in
the nmh case, it's a directory), then `M P a' for marking all
messages, then `B m' to move them.  This way, you lose the marks.

I think I converted to nnml by cheating.  You could replace all
occurrences of `nnmh' in .newsrc.eld with `nnml', then `M-x
nnml-generate-nov-databases RET'.

> Btw, I fixed a bug in my expiry-target patch for nnmh.  I've been
> using it now for a few days, and it seems to work fine.  Maybe
> you(?)  want to include it in Gnus?

I've put it off, but I want to.

> As you can see, I'll have to look at nnir.el first, google will
> probably help me.  But, I've always found pick to be very effective,
> (and didn't get immediate scoring to work.  will look at nnir) it is
> one of the two last nmh features I still use.

ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/

You should be able to find nnir.el there.  My idea was that it just
invokes pick and then shows you a summary buffer for a temporary
virtual group with the results.

> The other one is not really an nmh feature: I've written a crude
> script ``rpatch' that reads the current message, tries various
> unpack methods to find the patch, find a sensible name if none is
> specified, eg (<package>-<version>.<emailadrress>.diff.gz>) patches,
> save and possibly apply it (to LilyPond).  Maybe you happen to have
> some lisp code that does parts of that?

Well, you can use `|' to pipe the current message through any script,
including `rpatch', I guess.

kai
-- 
The arms should be held in a natural and unaffected way and never
be conspicuous. -- Revised Technique of Latin American Dancing



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: how does expiry-target work?
  2000-12-10 16:09         ` Kai Großjohann
@ 2000-12-15 17:32           ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Nieuwenhuizen @ 2000-12-15 17:32 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> As you can see, don't modify the ~/Mail directory outside of Gnus.
> Gnus will get very angry at you.

And I just remembered one other little detail, I sort my mail using
procmail and slocal.  I'd hate to give that up, show last:10 is so
much quicker than firing up emacs, when I dial in!  Guess I'm stuck
with nnmh for now?

> You should be able to find nnir.el there.  My idea was that it just
> invokes pick and then shows you a summary buffer for a temporary
> virtual group with the results.

Thanks, nnir is grand!  I've added a pick backend.  See

    http://appel.lilypond.org/software

that's also where the latest incarnation of my nnmh expiry patch
lives.  Would you have any ideas for scoring the results?

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-12-15 17:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-21 15:37 how does expiry-target work? janneke
2000-11-21 15:57 ` Kai Großjohann
2000-11-22 12:57   ` janneke
2000-11-22 22:11     ` ShengHuo ZHU
2000-12-06 15:25   ` Jan Nieuwenhuizen
2000-12-09  3:13     ` Kai Großjohann
2000-12-09 13:00       ` Jan Nieuwenhuizen
2000-12-10 16:09         ` Kai Großjohann
2000-12-15 17:32           ` Jan Nieuwenhuizen
2000-11-22  3:37 ` Harry Putnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).