Gnus development mailing list
 help / color / mirror / Atom feed
* Tell the Agent to download all articles as they are read
@ 2002-10-03 14:12 Kai Großjohann
  2002-10-03 14:39 ` Kai Großjohann
  2002-10-07  3:55 ` Danny Siu
  0 siblings, 2 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-03 14:12 UTC (permalink / raw)


I want the Agent to download an article when I read it.  So here's
what I did:

(defun kai-gnus-agent-fetch-article ()
  (let ((gnus-command-method gnus-current-select-method))
    (gnus-agent-fetch-articles
     gnus-newsgroup-name
     (list gnus-current-article))))
(add-hook 'gnus-select-article-hook 'kai-gnus-agent-fetch-article)

This seems to work.  But I think it's kludgy that I have to bind
gnus-command-method.

What do you think about putting this into Gnus?

kai

PS: After digging around in the source code for a while, I found that
    it seems to be normal to let-bind gnus-command-method like this.
    Okay.
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 14:12 Tell the Agent to download all articles as they are read Kai Großjohann
@ 2002-10-03 14:39 ` Kai Großjohann
  2002-10-03 15:26   ` Wes Hardaker
  2002-10-07  3:55 ` Danny Siu
  1 sibling, 1 reply; 18+ messages in thread
From: Kai Großjohann @ 2002-10-03 14:39 UTC (permalink / raw)


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

> What do you think about putting this into Gnus?

I've now done so.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 14:39 ` Kai Großjohann
@ 2002-10-03 15:26   ` Wes Hardaker
  2002-10-03 15:33     ` Kai Großjohann
  0 siblings, 1 reply; 18+ messages in thread
From: Wes Hardaker @ 2002-10-03 15:26 UTC (permalink / raw)
  Cc: ding

>>>>> On Thu, 03 Oct 2002 16:39:53 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said:

>> What do you think about putting this into Gnus?

Kai> I've now done so.

Which part did you commit?  Does it need to be enabled?

-- 
"The trouble with having an open mind, of course, is that people will
 insist on coming along and trying to put things in it."   -- Terry Pratchett



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 15:26   ` Wes Hardaker
@ 2002-10-03 15:33     ` Kai Großjohann
  2002-10-03 23:51       ` Wes Hardaker
  2002-10-05 21:32       ` Kai Großjohann
  0 siblings, 2 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-03 15:33 UTC (permalink / raw)


Wes Hardaker <wes@hardakers.net> writes:

>>>>>> On Thu, 03 Oct 2002 16:39:53 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said:
>
>>> What do you think about putting this into Gnus?
>
> Kai> I've now done so.
>
> Which part did you commit?  Does it need to be enabled?

I've committed a new function gnus-agent-fetch-selected-article which
you can add to gnus-select-article-hook or gnus-mark-article-hook.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 15:33     ` Kai Großjohann
@ 2002-10-03 23:51       ` Wes Hardaker
  2002-10-04  6:34         ` Kai Großjohann
  2002-10-05 21:32       ` Kai Großjohann
  1 sibling, 1 reply; 18+ messages in thread
From: Wes Hardaker @ 2002-10-03 23:51 UTC (permalink / raw)
  Cc: ding

>>>>> On Thu, 03 Oct 2002 17:33:03 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said:

Kai> I've committed a new function gnus-agent-fetch-selected-article
Kai> which you can add to gnus-select-article-hook or
Kai> gnus-mark-article-hook.

Would one hook be better than the other?

-- 
"The trouble with having an open mind, of course, is that people will
 insist on coming along and trying to put things in it."   -- Terry Pratchett



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 23:51       ` Wes Hardaker
@ 2002-10-04  6:34         ` Kai Großjohann
  2002-10-04 20:28           ` David S Goldberg
  0 siblings, 1 reply; 18+ messages in thread
From: Kai Großjohann @ 2002-10-04  6:34 UTC (permalink / raw)


Wes Hardaker <wes@hardakers.net> writes:

>>>>>> On Thu, 03 Oct 2002 17:33:03 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said:
>
> Kai> I've committed a new function gnus-agent-fetch-selected-article
> Kai> which you can add to gnus-select-article-hook or
> Kai> gnus-mark-article-hook.
>
> Would one hook be better than the other?

Tell me ;-)  gnus-select-article-hook is executed every time you
select a message for reading, gnus-mark-article-hook only the first
time.  I think for me, personally, it is better to use
gnus-select-article-hook because I want to (gradually) fetch all
articles into the agent, even those that I've read before.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-04  6:34         ` Kai Großjohann
@ 2002-10-04 20:28           ` David S Goldberg
  2002-10-05 21:31             ` Kai Großjohann
  0 siblings, 1 reply; 18+ messages in thread
From: David S Goldberg @ 2002-10-04 20:28 UTC (permalink / raw)


>>>>> On Fri, 04 Oct 2002 08:34:20 +0200,
>>>>> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said:

> Wes Hardaker <wes@hardakers.net> writes:
>>>>>>> On Thu, 03 Oct 2002 17:33:03 +0200,
>>>>>>> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) said: 
>> 
>> Would one hook be better than the other?

> Tell me ;-)  gnus-select-article-hook is executed every time you
> select a message for reading, gnus-mark-article-hook only the first
> time.  I think for me, personally, it is better to use
> gnus-select-article-hook because I want to (gradually) fetch all
> articles into the agent, even those that I've read before.

We'll I've put it on gnus-mark-article-hook because I'm not sure I
want to do that (I've also wrapped it in a lamda so it only happens in
my nnimap groups).  One question, though.  Does expiry remove articles
from the agent as well as the IMAP server?  If so, then I'd be more
inclined to put it on gnus-select-article-hook.

Thanks,
-- 
Dave Goldberg
david.goldberg6@verizon.net





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

* Re: Tell the Agent to download all articles as they are read
  2002-10-04 20:28           ` David S Goldberg
@ 2002-10-05 21:31             ` Kai Großjohann
  0 siblings, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-05 21:31 UTC (permalink / raw)


David S Goldberg <david.goldberg6@verizon.net> writes:

> We'll I've put it on gnus-mark-article-hook because I'm not sure I
> want to do that (I've also wrapped it in a lamda so it only happens in
> my nnimap groups).  One question, though.  Does expiry remove articles
> from the agent as well as the IMAP server?  If so, then I'd be more
> inclined to put it on gnus-select-article-hook.

No, the agent has its own expiry mechanism, viz, M-x
gnus-agent-expire RET.

I've just fixed a bug where the function would do something for
unagentized servers, and fail.  I hope it's better now.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 15:33     ` Kai Großjohann
  2002-10-03 23:51       ` Wes Hardaker
@ 2002-10-05 21:32       ` Kai Großjohann
  1 sibling, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-05 21:32 UTC (permalink / raw)


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

> I've committed a new function gnus-agent-fetch-selected-article which
> you can add to gnus-select-article-hook or gnus-mark-article-hook.

I think the function does not do the right thing.  Imagine I read a
message, then move it to another group.  Ideally, I'd like the Agent
to know about that message in the new, target, group.  But I think
that this is not happening...

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-03 14:12 Tell the Agent to download all articles as they are read Kai Großjohann
  2002-10-03 14:39 ` Kai Großjohann
@ 2002-10-07  3:55 ` Danny Siu
  2002-10-08 17:50   ` Kai Großjohann
  1 sibling, 1 reply; 18+ messages in thread
From: Danny Siu @ 2002-10-07  3:55 UTC (permalink / raw)



I got the following when I added gnus-agent-fetch-selected-article to
gnus-select-article-hook 

Debugger entered--Lisp error: (error "Selecting deleted buffer")
  gnus-agent-enter-history("4.3.2.7.2.20021004171722.017f3e90@mailjapan.pac.adobe.com" (("nnimap+mcmug:Admin/Admin" . 240)) 731130)
  gnus-agent-fetch-articles("nnimap+mcmug:Admin/Admin" (240))
  gnus-agent-fetch-selected-article()
  run-hooks(gnus-select-article-hook)
  apply(run-hooks gnus-select-article-hook)
  gnus-run-hooks(gnus-select-article-hook)
  gnus-summary-display-article(240)
  gnus-summary-next-page(nil)
* call-interactively(gnus-summary-next-page)


Kai Großjohann writes:

  Kai> I want the Agent to download an article when I read it.  So here's
  Kai> what I did:

  Kai> (defun kai-gnus-agent-fetch-article ()
  Kai>   (let ((gnus-command-method gnus-current-select-method))
  Kai>     (gnus-agent-fetch-articles
  Kai>      gnus-newsgroup-name (list gnus-current-article))))
  Kai> (add-hook 'gnus-select-article-hook 'kai-gnus-agent-fetch-article)

  Kai> This seems to work.  But I think it's kludgy that I have to bind
  Kai> gnus-command-method.

  Kai> What do you think about putting this into Gnus?

  Kai> kai

  Kai> PS: After digging around in the source code for a while, I found that
  Kai>     it seems to be normal to let-bind gnus-command-method like this.
  Kai>     Okay.
  Kai> -- ~/.signature is: umop ap!sdn (Frank Nobis)


-- 
Danny Siu




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

* Re: Tell the Agent to download all articles as they are read
  2002-10-07  3:55 ` Danny Siu
@ 2002-10-08 17:50   ` Kai Großjohann
  2002-10-11  4:15     ` Danny Siu
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-08 17:50 UTC (permalink / raw)


Danny Siu <dsiu@adobe.com> writes:

> I got the following when I added gnus-agent-fetch-selected-article to
> gnus-select-article-hook 
>
> Debugger entered--Lisp error: (error "Selecting deleted buffer")
>   gnus-agent-enter-history("4.3.2.7.2.20021004171722.017f3e90@mailjapan.pac.adobe.com" (("nnimap+mcmug:Admin/Admin" . 240)) 731130)

I think I fixed it.  Will commit in a jiffy.  Please test after this.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-08 17:50   ` Kai Großjohann
@ 2002-10-11  4:15     ` Danny Siu
  2002-10-11  8:35       ` Kai Großjohann
  2002-10-11  4:15     ` Danny Siu
  2002-10-14  9:34     ` Danny Siu
  2 siblings, 1 reply; 18+ messages in thread
From: Danny Siu @ 2002-10-11  4:15 UTC (permalink / raw)


Kai,

Another side effect of using gnus-agent-fetch-selected-article is that each
article when selected are fetched twice from the server.  Usually it is not
a problem but for articles with sizable attachement, the time wasted becomes
obvious.

-- 
Danny Siu

Kai Großjohann writes:

  Kai> Danny Siu <dsiu@adobe.com> writes:
  >> I got the following when I added gnus-agent-fetch-selected-article to
  >> gnus-select-article-hook
  >>
  >> Debugger entered--Lisp error: (error "Selecting deleted buffer")
  >> gnus-agent-enter-history("4.3.2.7.2.20021004171722.017f3e90@mailjapan.pac.adobe.com"
  >> (("nnimap+mcmug:Admin/Admin" . 240)) 731130)

  Kai> I think I fixed it.  Will commit in a jiffy.  Please test after this.

  Kai> kai -- ~/.signature is: umop ap!sdn (Frank Nobis)





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

* Re: Tell the Agent to download all articles as they are read
  2002-10-08 17:50   ` Kai Großjohann
  2002-10-11  4:15     ` Danny Siu
@ 2002-10-11  4:15     ` Danny Siu
  2002-10-14  9:34     ` Danny Siu
  2 siblings, 0 replies; 18+ messages in thread
From: Danny Siu @ 2002-10-11  4:15 UTC (permalink / raw)


Kai,

Another side effect of using gnus-agent-fetch-selected-article is that each
article when selected are fetched twice from the server.  Usually it is not
a problem but for articles with sizable attachement, the time wasted becomes
obvious.

-- 
Danny Siu

Kai Großjohann writes:

  Kai> Danny Siu <dsiu@adobe.com> writes:
  >> I got the following when I added gnus-agent-fetch-selected-article to
  >> gnus-select-article-hook
  >>
  >> Debugger entered--Lisp error: (error "Selecting deleted buffer")
  >> gnus-agent-enter-history("4.3.2.7.2.20021004171722.017f3e90@mailjapan.pac.adobe.com"
  >> (("nnimap+mcmug:Admin/Admin" . 240)) 731130)

  Kai> I think I fixed it.  Will commit in a jiffy.  Please test after this.

  Kai> kai -- ~/.signature is: umop ap!sdn (Frank Nobis)





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

* Re: Tell the Agent to download all articles as they are read
  2002-10-11  4:15     ` Danny Siu
@ 2002-10-11  8:35       ` Kai Großjohann
  0 siblings, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-11  8:35 UTC (permalink / raw)


Danny Siu <dsiu@adobe.com> writes:

> Another side effect of using gnus-agent-fetch-selected-article is
> that each article when selected are fetched twice from the server.
> Usually it is not a problem but for articles with sizable
> attachement, the time wasted becomes obvious.

Right.  What can I do?  What happens if you set gnus-keep-backlog to
1 or 2 or 3?  This could be a kludgy workaround, but I don't feel
it's the right solution.  Opinions?

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-08 17:50   ` Kai Großjohann
  2002-10-11  4:15     ` Danny Siu
  2002-10-11  4:15     ` Danny Siu
@ 2002-10-14  9:34     ` Danny Siu
  2002-10-14 12:14       ` Kai Großjohann
  2 siblings, 1 reply; 18+ messages in thread
From: Danny Siu @ 2002-10-14  9:34 UTC (permalink / raw)



hmm.  the problem is still happening with the lastest (Oct 14 2002 02:15am
PST) fetch CVS.

Kai Großjohann writes:

  Kai> Danny Siu <dsiu@adobe.com> writes:
  >> I got the following when I added gnus-agent-fetch-selected-article to
  >> gnus-select-article-hook
  >>
  >> Debugger entered--Lisp error: (error "Selecting deleted buffer")
  >> gnus-agent-enter-history("4.3.2.7.2.20021004171722.017f3e90@mailjapan.pac.adobe.com"
  >> (("nnimap+mcmug:Admin/Admin" . 240)) 731130)

  Kai> I think I fixed it.  Will commit in a jiffy.  Please test after this.

  Kai> kai -- ~/.signature is: umop ap!sdn (Frank Nobis)


-- 
Danny Siu




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

* Re: Tell the Agent to download all articles as they are read
  2002-10-14  9:34     ` Danny Siu
@ 2002-10-14 12:14       ` Kai Großjohann
  2002-10-15  6:14         ` Danny Siu
  0 siblings, 1 reply; 18+ messages in thread
From: Kai Großjohann @ 2002-10-14 12:14 UTC (permalink / raw)


Danny Siu <dsiu@adobe.com> writes:

> hmm.  the problem is still happening with the lastest (Oct 14 2002 02:15am
> PST) fetch CVS.

Strange!  Could you edebug-defun on gnus-agent-fetch-selected-article
and then step through it to see what happens?  You'll see the unless
statement which is supposed to take care of opening the history if
necessary.  Maybe I chose the wrong condition?

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

* Re: Tell the Agent to download all articles as they are read
  2002-10-14 12:14       ` Kai Großjohann
@ 2002-10-15  6:14         ` Danny Siu
  2002-10-15  9:22           ` Kai Großjohann
  0 siblings, 1 reply; 18+ messages in thread
From: Danny Siu @ 2002-10-15  6:14 UTC (permalink / raw)



i edebuged into defun gnus-agent-fetch-selected-article and found
gnus-plugged is true and (gnus-agent-history-buffer) returns a killed
buffer.  strange.  

when exactly does gnus-agent-open-history get called?

(defun gnus-agent-fetch-selected-article ()
  "Fetch the current article as it is selected.
This can be added to `gnus-select-article-hook' or
`gnus-mark-article-hook'."
  (let ((gnus-command-method gnus-current-select-method))
    (when (and gnus-plugged (gnus-agent-method-p gnus-command-method))
      (let ((gnus-agent-current-history
	     (gnus-agent-history-buffer)))
	(gnus-agent-fetch-articles
	 gnus-newsgroup-name
	 (list gnus-current-article))))))


Kai Großjohann writes:

  Kai> Danny Siu <dsiu@adobe.com> writes:
  >> hmm.  the problem is still happening with the lastest (Oct 14 2002
  >> 02:15am PST) fetch CVS.

  Kai> Strange!  Could you edebug-defun on gnus-agent-fetch-selected-article
  Kai> and then step through it to see what happens?  You'll see the unless
  Kai> statement which is supposed to take care of opening the history if
  Kai> necessary.  Maybe I chose the wrong condition?

  Kai> kai -- ~/.signature is: umop ap!sdn (Frank Nobis)


-- 
Danny Siu




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

* Re: Tell the Agent to download all articles as they are read
  2002-10-15  6:14         ` Danny Siu
@ 2002-10-15  9:22           ` Kai Großjohann
  0 siblings, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2002-10-15  9:22 UTC (permalink / raw)


Danny Siu <dsiu@adobe.com> writes:

> (defun gnus-agent-fetch-selected-article ()
>   "Fetch the current article as it is selected.
> This can be added to `gnus-select-article-hook' or
> `gnus-mark-article-hook'."
>   (let ((gnus-command-method gnus-current-select-method))
>     (when (and gnus-plugged (gnus-agent-method-p gnus-command-method))
>       (let ((gnus-agent-current-history
> 	     (gnus-agent-history-buffer)))
> 	(gnus-agent-fetch-articles
> 	 gnus-newsgroup-name
> 	 (list gnus-current-article))))))

This is not the current version.  The CVS commit is running as we
speak.  Sorry that I forgot this, I fixed it on Oct 10 already.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



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

end of thread, other threads:[~2002-10-15  9:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 14:12 Tell the Agent to download all articles as they are read Kai Großjohann
2002-10-03 14:39 ` Kai Großjohann
2002-10-03 15:26   ` Wes Hardaker
2002-10-03 15:33     ` Kai Großjohann
2002-10-03 23:51       ` Wes Hardaker
2002-10-04  6:34         ` Kai Großjohann
2002-10-04 20:28           ` David S Goldberg
2002-10-05 21:31             ` Kai Großjohann
2002-10-05 21:32       ` Kai Großjohann
2002-10-07  3:55 ` Danny Siu
2002-10-08 17:50   ` Kai Großjohann
2002-10-11  4:15     ` Danny Siu
2002-10-11  8:35       ` Kai Großjohann
2002-10-11  4:15     ` Danny Siu
2002-10-14  9:34     ` Danny Siu
2002-10-14 12:14       ` Kai Großjohann
2002-10-15  6:14         ` Danny Siu
2002-10-15  9:22           ` Kai Großjohann

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