Gnus development mailing list
 help / color / mirror / Atom feed
* Do stuff on nnchoke-accept-article?
@ 1998-10-14 21:27 Kai Grossjohann
  1998-10-14 21:28 ` Kai Grossjohann
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-14 21:27 UTC (permalink / raw)


Is there a way (a hook) to do stuff whenever an article is entered
into a group?  Be it because it's a new mail, be it from B c or B m or
B r, no matter.

I'd like to remember the message-id and what group the message was
written to.

kai
-- 
I wonder why nobody don't like me,
or is it de fact dat I'm ugly? -- Harry Belafonte


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-14 21:27 Do stuff on nnchoke-accept-article? Kai Grossjohann
@ 1998-10-14 21:28 ` Kai Grossjohann
  1998-10-17 21:05 ` Lars Magne Ingebrigtsen
  1998-10-25 16:36 ` Kai Grossjohann
  2 siblings, 0 replies; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-14 21:28 UTC (permalink / raw)


I forgot Gcc as a method for writing a message into a group.
kai
-- 
I wonder why nobody don't like me,
or is it de fact dat I'm ugly? -- Harry Belafonte


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-14 21:27 Do stuff on nnchoke-accept-article? Kai Grossjohann
  1998-10-14 21:28 ` Kai Grossjohann
@ 1998-10-17 21:05 ` Lars Magne Ingebrigtsen
  1998-10-19 19:53   ` Kai Grossjohann
  1998-10-25 16:23   ` Kai Grossjohann
  1998-10-25 16:36 ` Kai Grossjohann
  2 siblings, 2 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-17 21:05 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Is there a way (a hook) to do stuff whenever an article is entered
> into a group?  Be it because it's a new mail, be it from B c or B m or
> B r, no matter.

I don't think so, but I could add one if you want one.

> I'd like to remember the message-id and what group the message was
> written to.

You couldn't do that with a hook, since there really isn't any
variable that says which group the mail is destined for.
`*-request-accept-article', for instance, uses `group', while
`nnfolder-save-mail' uses the `group-art' cons cell.

One could add a `nnmail-new-message-function' variable that could be
set to a function that takes a group name as a parameter, and then
have all the mail backends call that one for each new message, no
matter how it was received.  If you want to write something like that,
I'll accept the patch.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-17 21:05 ` Lars Magne Ingebrigtsen
@ 1998-10-19 19:53   ` Kai Grossjohann
  1998-10-19 20:12     ` Lars Magne Ingebrigtsen
  1998-10-25 16:23   ` Kai Grossjohann
  1 sibling, 1 reply; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-19 19:53 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

  > You couldn't do that with a hook, since there really isn't any
  > variable that says which group the mail is destined for.
  > `*-request-accept-article', for instance, uses `group', while
  > `nnfolder-save-mail' uses the `group-art' cons cell.

Hm.  Are people supposed to use nnfolder-save-mail to save stuff into
a Gnus group?  I always thought that was a no-no.

kai
-- 
In Turkey, we played well and lost.  In Moldavia, we played badly and won.
This raises the question: which is better?  (Oliver Kahn, German soccer team)


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-19 19:53   ` Kai Grossjohann
@ 1998-10-19 20:12     ` Lars Magne Ingebrigtsen
  1998-10-20 11:30       ` Kai Grossjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-19 20:12 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Hm.  Are people supposed to use nnfolder-save-mail to save stuff into
> a Gnus group?  I always thought that was a no-no.

It is, but that is the function that's called way, way deep down in
the code when splitting mail.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-19 20:12     ` Lars Magne Ingebrigtsen
@ 1998-10-20 11:30       ` Kai Grossjohann
  0 siblings, 0 replies; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-20 11:30 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

  > It is, but that is the function that's called way, way deep down
  > in the code when splitting mail.

Are you saying that nnfolder-request-accept-article is circumvented
when splitting mail?  If it isn't circumvented, then the `do stuff on
nnchoke-request-accept-article' mechanism ought to work.

kai
-- 
In Turkey, we played well and lost.  In Moldavia, we played badly and won.
This raises the question: which is better?  (Oliver Kahn, German soccer team)


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-17 21:05 ` Lars Magne Ingebrigtsen
  1998-10-19 19:53   ` Kai Grossjohann
@ 1998-10-25 16:23   ` Kai Grossjohann
  1998-10-25 16:28     ` Kai Grossjohann
  1998-10-25 17:08     ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-25 16:23 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

  > Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:
  > 
  > > Is there a way (a hook) to do stuff whenever an article is entered
  > > into a group?  Be it because it's a new mail, be it from B c or B m or
  > > B r, no matter.
  > 
  > I don't think so, but I could add one if you want one.

Isn't it so that nnchoke-save-mail gets called every time a message is
saved?  And apparently (I looked at nnfolder and nnml)
nnchoke-save-mail runs nnmail-prepare-save-mail-hook rather early on.

  > > I'd like to remember the message-id and what group the message was
  > > written to.
  > 
  > You couldn't do that with a hook, since there really isn't any
  > variable that says which group the mail is destined for.
  > `*-request-accept-article', for instance, uses `group', while
  > `nnfolder-save-mail' uses the `group-art' cons cell.

Well, nnmail-prepare-save-mail-hook appears to be run in
nnchoke-save-mail, and nnchoke-save-mail appears to be run from
nnchoke-request-accept-article, so all that's needed is consistent
naming of the parameters of those functions, then they can be accessed
from within the hook, no?  (Oh, the wonders of dynamic binding, or
extent, or whatever it's really called...)

(nnfolder-save-mail takes an argument `group-art-list', whereas
nnml-save-mail takes an argument `group-art' -- why?)

kai
-- 
Life is hard and then you die.


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-25 16:23   ` Kai Grossjohann
@ 1998-10-25 16:28     ` Kai Grossjohann
  1998-10-25 17:07       ` Lars Magne Ingebrigtsen
  1998-10-25 17:08     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-25 16:28 UTC (permalink / raw)


>>>>> Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

  > (nnfolder-save-mail takes an argument `group-art-list', whereas
  > nnml-save-mail takes an argument `group-art' -- why?)

Here's the full story:

,-----
| [marcy] grep 'defun nn.*-save-mail' nn*.el
| nnbabyl.el:(defun nnbabyl-save-mail (group-art)
| nnfolder.el:(defun nnfolder-save-mail (group-art-list)
| nnmbox.el:(defun nnmbox-save-mail (group-art)
| nnmh.el:(defun nnmh-save-mail (group-art &optional noinsert)
| nnml.el:(defun nnml-save-mail (group-art)
| [marcy]
`-----

Apparently, all backends use group-art except for nnfolder.  Is this a
bug?

kai
-- 
Life is hard and then you die.


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-14 21:27 Do stuff on nnchoke-accept-article? Kai Grossjohann
  1998-10-14 21:28 ` Kai Grossjohann
  1998-10-17 21:05 ` Lars Magne Ingebrigtsen
@ 1998-10-25 16:36 ` Kai Grossjohann
  1998-10-26  2:44   ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 12+ messages in thread
From: Kai Grossjohann @ 1998-10-25 16:36 UTC (permalink / raw)


>>>>> Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

  > I'd like to remember the message-id and what group the message was
  > written to.

Let me explain the reason behind all this.  Then Lars can decide
whether he or I should do a clean interface for this extension, or
whether we want to make do with a kludge.

I find that not all of my mail can be automatically split using the
traditional mechanism.  This is because I get messages from people
where I cannot decide beforehand which folder they belong to.  My idea
for splitting these messages is as follows:

Whenever a mail is put into a group, Gnus remembers the message id
and the group.  Now, all new messages have their references header
checked, and if I find that the `father' has been written to some
group, I just split the new reply to the same group.

I believe this would help quite a bit for those cases where you have
to manually decide which group a mail should belong to: all replies
and followups are automatically put into the same group.

Wouldn't this be a nifty feature?  Lars, can you tell me how we want
to do this remembering the groups and message ids thing?  Use the
predefined nnmail-prepare-save-mail-hook or use something new?  What
should the new thing look like?

kai
-- 
Life is hard and then you die.


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-25 16:28     ` Kai Grossjohann
@ 1998-10-25 17:07       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-25 17:07 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Apparently, all backends use group-art except for nnfolder.  Is this a
> bug?

No -- nn*-save-mail is an internal function.  It's only laziness on my
part that they are all called the same and take similar parameters.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-25 16:23   ` Kai Grossjohann
  1998-10-25 16:28     ` Kai Grossjohann
@ 1998-10-25 17:08     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-25 17:08 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Well, nnmail-prepare-save-mail-hook appears to be run in
> nnchoke-save-mail, and nnchoke-save-mail appears to be run from
> nnchoke-request-accept-article, so all that's needed is consistent
> naming of the parameters of those functions, then they can be accessed
> from within the hook, no?

Yes.  But if we want to "export" these variables, they should be given
proper names, like `nnmail-group-article-alist', or something.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: Do stuff on nnchoke-accept-article?
  1998-10-25 16:36 ` Kai Grossjohann
@ 1998-10-26  2:44   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-10-26  2:44 UTC (permalink / raw)


Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Wouldn't this be a nifty feature?

Sounds nifty.

> Lars, can you tell me how we want to do this remembering the groups
> and message ids thing?  Use the predefined
> nnmail-prepare-save-mail-hook or use something new?  What should the
> new thing look like?

I think the most logical place to do this would be in
`nnmail-check-duplication'.  It already keeps track of Message-ID's --
you could extend it (or rather, `nnmail-cache-insert') to put the
group name and number at the end of each line.  This should even be
backwards- and forwards-compatible.

And then you'd write a function to look into the cache and return the
group/article number.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

end of thread, other threads:[~1998-10-26  2:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-14 21:27 Do stuff on nnchoke-accept-article? Kai Grossjohann
1998-10-14 21:28 ` Kai Grossjohann
1998-10-17 21:05 ` Lars Magne Ingebrigtsen
1998-10-19 19:53   ` Kai Grossjohann
1998-10-19 20:12     ` Lars Magne Ingebrigtsen
1998-10-20 11:30       ` Kai Grossjohann
1998-10-25 16:23   ` Kai Grossjohann
1998-10-25 16:28     ` Kai Grossjohann
1998-10-25 17:07       ` Lars Magne Ingebrigtsen
1998-10-25 17:08     ` Lars Magne Ingebrigtsen
1998-10-25 16:36 ` Kai Grossjohann
1998-10-26  2:44   ` Lars Magne Ingebrigtsen

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