Gnus development mailing list
 help / color / mirror / Atom feed
* Does article prefetching work on IMAP?
@ 2021-08-02  7:17 Pankaj Jangid
  2021-08-03 17:28 ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2021-08-02  7:17 UTC (permalink / raw)
  To: Gnus Users

Does article prefetching work with IMAP backend? If yes, then why it is
required to have an active internet connection when reading article?

-- 
Regards ~Pankaj


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

* Re: Does article prefetching work on IMAP?
  2021-08-02  7:17 Does article prefetching work on IMAP? Pankaj Jangid
@ 2021-08-03 17:28 ` Eric Abrahamsen
  2021-08-03 17:55   ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2021-08-03 17:28 UTC (permalink / raw)
  To: Gnus Users

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> Does article prefetching work with IMAP backend? If yes, then why it is
> required to have an active internet connection when reading article?

No, right now it only works with nntp. In the past I've looked into
adding it for nnimap and it wouldn't be that hard, I just haven't gotten
around to doing it.


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

* Re: Does article prefetching work on IMAP?
  2021-08-03 17:28 ` Eric Abrahamsen
@ 2021-08-03 17:55   ` Pankaj Jangid
  2021-08-04  7:51     ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2021-08-03 17:55 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>
>> Does article prefetching work with IMAP backend? If yes, then why it is
>> required to have an active internet connection when reading article?
>
> No, right now it only works with nntp. In the past I've looked into
> adding it for nnimap and it wouldn't be that hard, I just haven't gotten
> around to doing it.

Thanks for the information. 



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

* Re: Does article prefetching work on IMAP?
  2021-08-03 17:55   ` Pankaj Jangid
@ 2021-08-04  7:51     ` Pankaj Jangid
  2021-08-04 17:56       ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Pankaj Jangid @ 2021-08-04  7:51 UTC (permalink / raw)
  To: ding

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>>
>>> Does article prefetching work with IMAP backend? If yes, then why it is
>>> required to have an active internet connection when reading article?
>>
>> No, right now it only works with nntp. In the past I've looked into
>> adding it for nnimap and it wouldn't be that hard, I just haven't gotten
>> around to doing it.
>
> Thanks for the information. 

Eric, could you please point me to a place where this should be
done? With some guidance, I should be able to do it.



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

* Re: Does article prefetching work on IMAP?
  2021-08-04  7:51     ` Pankaj Jangid
@ 2021-08-04 17:56       ` Eric Abrahamsen
  2021-08-05  6:09         ` Pankaj Jangid
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2021-08-04 17:56 UTC (permalink / raw)
  To: ding

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>>>
>>>> Does article prefetching work with IMAP backend? If yes, then why it is
>>>> required to have an active internet connection when reading article?
>>>
>>> No, right now it only works with nntp. In the past I've looked into
>>> adding it for nnimap and it wouldn't be that hard, I just haven't gotten
>>> around to doing it.
>>
>> Thanks for the information. 
>
> Eric, could you please point me to a place where this should be
> done? With some guidance, I should be able to do it.

You mean write the code? That would be very welcome!

Async/prefetching works by opening multiple connections to a single
server. Those connections are stored and tracked in
`nntp-connection-alist', for nntp, and `nnimap-connection-alist', for
nnimap. nnimap.el has the code to handle multiple connections, but that
functionality isn't currently used.

The problem is in gnus-async.el, which is hard-coded to only work with
nntp. I believe the only function that would need to be changed would be
`gnus-async-wait-for-article', which currently calls
`nntp-find-connection' and `nntp-accept-process-output': these calls
would have to be abstracted to work with any server.

Ideally we'd make *-find-connection a deffoo, and then add a
`gnus-server-find-connection' function to gnus-int.el. I'm not sure how
to handle getting rid of the `nntp-accept-process-output' call.

Finally, you'd have to add:

(deffoo nnimap-asynchronous-p ()
  t)

to nnimap.el, in order to set the whole thing in motion.

I'm happy to help with further review or troubleshooting.

Thanks!
Eric



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

* Re: Does article prefetching work on IMAP?
  2021-08-04 17:56       ` Eric Abrahamsen
@ 2021-08-05  6:09         ` Pankaj Jangid
  0 siblings, 0 replies; 6+ messages in thread
From: Pankaj Jangid @ 2021-08-05  6:09 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

>> Eric, could you please point me to a place where this should be
>> done? With some guidance, I should be able to do it.
>
> You mean write the code? That would be very welcome!
>
> Async/prefetching works by opening multiple connections to a single
> server. Those connections are stored and tracked in
> `nntp-connection-alist', for nntp, and `nnimap-connection-alist', for
> nnimap. nnimap.el has the code to handle multiple connections, but that
> functionality isn't currently used.
>
> The problem is in gnus-async.el, which is hard-coded to only work with
> nntp. I believe the only function that would need to be changed would be
> `gnus-async-wait-for-article', which currently calls
> `nntp-find-connection' and `nntp-accept-process-output': these calls
> would have to be abstracted to work with any server.
>
> Ideally we'd make *-find-connection a deffoo, and then add a
> `gnus-server-find-connection' function to gnus-int.el. I'm not sure how
> to handle getting rid of the `nntp-accept-process-output' call.
>
> Finally, you'd have to add:
>
> (deffoo nnimap-asynchronous-p ()
>   t)
>
> to nnimap.el, in order to set the whole thing in motion.
>

Yes. I meant to write code.

Thanks for sharing these valuable pointers. This should be okay to get
started.




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

end of thread, other threads:[~2021-08-05  6:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02  7:17 Does article prefetching work on IMAP? Pankaj Jangid
2021-08-03 17:28 ` Eric Abrahamsen
2021-08-03 17:55   ` Pankaj Jangid
2021-08-04  7:51     ` Pankaj Jangid
2021-08-04 17:56       ` Eric Abrahamsen
2021-08-05  6:09         ` Pankaj Jangid

Gnus development mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/ding

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 ding ding/ https://inbox.vuxu.org/ding \
		ding@inbox.vuxu.org
	public-inbox-index ding

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.emacs.gnus.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git