bug#40280: gnus-cloud doesn't do anything useful

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#40280: gnus-cloud doesn't do anything useful

Basil L. Contovounesios

> From a3bdd2219855a72e2ee90de1b6f823c9678a470c Mon Sep 17 00:00:00 2001
> From: David Edmondson <[hidden email]>
> Date: Sat, 28 Mar 2020 19:03:58 +0000
> Subject: [PATCH] gnus-cloud: Improve cloud sync
>
> After replaying a set of actions downloaded by gnus-cloud, persist the
> highest sequence number seen as the local `gnus-cloud-sequence'
> number, in order that a future download will not unnecessarily replay
> previously seen actions and any future uploads from this emacs
> instance use a higher sequence number than that downloaded.
>
> Remove the test on whether individual newsrc entries are older than
> the current time, as that is always going to be the case.

In the future please follow the formatting guidelines for change log
messages described in the file CONTRIBUTE.

[...]

> --- a/lisp/gnus/gnus-cloud.el
> +++ b/lisp/gnus/gnus-cloud.el
> @@ -480,7 +478,9 @@ Otherwise, returns the Gnus Cloud data chunks."
>            (push (gnus-cloud-parse-chunk) chunks)
>            (forward-line 1))))
>      (if update
> -        (mapcar #'gnus-cloud-update-all chunks)
> +        (progn
> +  (mapcar #'gnus-cloud-update-all chunks)
> +  (setq gnus-cloud-sequence highest-sequence-seen))
>        chunks)))

This change means the result of the mapcar is no longer used or
returned, giving rise to the following warning:

  In gnus-cloud-download-data:
  gnus/gnus-cloud.el:482:12: Warning: ‘mapcar’ called for effect; use ‘mapc’ or
      ‘dolist’ instead

It also makes highest-sequence-seen the return value of
gnus-cloud-download-data.  Is this intended?

Thanks,

--
Basil



Reply | Threaded
Open this post in threaded view
|

bug#40280: gnus-cloud doesn't do anything useful

David Edmondson-2
On Tuesday, 2020-06-16 at 19:56:05 +01, Basil L. Contovounesios wrote:

>> From a3bdd2219855a72e2ee90de1b6f823c9678a470c Mon Sep 17 00:00:00 2001
>> From: David Edmondson <[hidden email]>
>> Date: Sat, 28 Mar 2020 19:03:58 +0000
>> Subject: [PATCH] gnus-cloud: Improve cloud sync
>>
>> After replaying a set of actions downloaded by gnus-cloud, persist the
>> highest sequence number seen as the local `gnus-cloud-sequence'
>> number, in order that a future download will not unnecessarily replay
>> previously seen actions and any future uploads from this emacs
>> instance use a higher sequence number than that downloaded.
>>
>> Remove the test on whether individual newsrc entries are older than
>> the current time, as that is always going to be the case.
>
> In the future please follow the formatting guidelines for change log
> messages described in the file CONTRIBUTE.

Understood.

> [...]
>
>> --- a/lisp/gnus/gnus-cloud.el
>> +++ b/lisp/gnus/gnus-cloud.el
>> @@ -480,7 +478,9 @@ Otherwise, returns the Gnus Cloud data chunks."
>>            (push (gnus-cloud-parse-chunk) chunks)
>>            (forward-line 1))))
>>      (if update
>> -        (mapcar #'gnus-cloud-update-all chunks)
>> +        (progn
>> +  (mapcar #'gnus-cloud-update-all chunks)
>> +  (setq gnus-cloud-sequence highest-sequence-seen))
>>        chunks)))
>
> This change means the result of the mapcar is no longer used or
> returned, giving rise to the following warning:
>
>   In gnus-cloud-download-data:
>   gnus/gnus-cloud.el:482:12: Warning: ‘mapcar’ called for effect; use ‘mapc’ or
>       ‘dolist’ instead
>
> It also makes highest-sequence-seen the return value of
> gnus-cloud-download-data.  Is this intended?

No, it's not an intended change and is not desirable. Presumably
replacing `progn' with `prog1' would properly restore the previous
behaviour.

Should I submit a further patch?

dme.
--
J'aurais toujours faim de toi.



Reply | Threaded
Open this post in threaded view
|

bug#40280: gnus-cloud doesn't do anything useful

Ted Zlatanov
On Wed, 17 Jun 2020 09:13:29 +0100 David Edmondson <[hidden email]> wrote:

DE> On Tuesday, 2020-06-16 at 19:56:05 +01, Basil L. Contovounesios wrote:
>> This change means the result of the mapcar is no longer used or
>> returned, giving rise to the following warning:
>>
>> In gnus-cloud-download-data:
>> gnus/gnus-cloud.el:482:12: Warning: ‘mapcar’ called for effect; use ‘mapc’ or
>> ‘dolist’ instead
>>
>> It also makes highest-sequence-seen the return value of
>> gnus-cloud-download-data.  Is this intended?

DE> No, it's not an intended change and is not desirable. Presumably
DE> replacing `progn' with `prog1' would properly restore the previous
DE> behaviour.

DE> Should I submit a further patch?

Please do. Thanks to you and Basil.

Ted



Reply | Threaded
Open this post in threaded view
|

bug#40280: [PATCH] Fix gnus-cloud-download-all-data return value

David Edmondson-2
* lisp/gnus/gnus-cloud.el (gnus-cloud-download-data): Return the
result of calling `gnus-cloud-update-all' when UPDATE is t, as per the
documented behaviour.
---
 lisp/gnus/gnus-cloud.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el
index 5028da5e8d..f730518241 100644
--- a/lisp/gnus/gnus-cloud.el
+++ b/lisp/gnus/gnus-cloud.el
@@ -478,8 +478,8 @@ Otherwise, returns the Gnus Cloud data chunks."
           (push (gnus-cloud-parse-chunk) chunks)
           (forward-line 1))))
     (if update
-        (progn
-  (mapc #'gnus-cloud-update-all chunks)
+        (prog1
+  (mapcar #'gnus-cloud-update-all chunks)
   (setq gnus-cloud-sequence highest-sequence-seen))
       chunks)))
 
--
2.27.0




Reply | Threaded
Open this post in threaded view
|

bug#40280: [PATCH] Fix gnus-cloud-download-all-data return value

Ted Zlatanov
On Tue, 23 Jun 2020 12:52:34 +0100 David Edmondson <[hidden email]> wrote:

DE> * lisp/gnus/gnus-cloud.el (gnus-cloud-download-data): Return the
DE> result of calling `gnus-cloud-update-all' when UPDATE is t, as per the
DE> documented behaviour.

Thanks David. Applied with slightly adjusted commit message.

Ted