Gnus development mailing list
 help / color / mirror / Atom feed
* [patch] gnus-agent doesn't always synchronise flags if asked to
@ 2007-09-08 14:54 Elias Oltmanns
  2007-11-09 13:33 ` Elias Oltmanns
  0 siblings, 1 reply; 5+ messages in thread
From: Elias Oltmanns @ 2007-09-08 14:54 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Hi all,

when gnus is switched into plugged mode and any of the agentised servers
is offline at the time, the user is asked whether to switch that server
into online mode. However, neither then, nor when gnus actually opens a
connection to that server (for instance after pressing g in the group
buffer) flags are synchronised even though gnus-agent-synchronize-flags
is set to t or 'ask.

I suggest to call gnus-agent-possibly-synchronize-flags from
gnus-open-server. Please find the patch below.

Regards,

Elias


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sync.patch --]
[-- Type: text/x-patch, Size: 3153 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 7.70
diff -u -r7.70 gnus-agent.el
--- lisp/gnus-agent.el	14 Aug 2007 11:45:48 -0000	7.70
+++ lisp/gnus-agent.el	8 Sep 2007 14:42:49 -0000
@@ -636,8 +636,7 @@
                  (gnus-agent-make-mode-line-string " Plugged"
                                                    'mouse-2
                                                    'gnus-agent-toggle-plugged))
-         (gnus-agent-go-online gnus-agent-go-online)
-         (gnus-agent-possibly-synchronize-flags))
+         (gnus-agent-go-online gnus-agent-go-online))
         (t
          (gnus-agent-close-connections)
          (setq gnus-plugged set-to)
@@ -868,8 +867,7 @@
   (interactive)
   (save-excursion
     (dolist (gnus-command-method (gnus-agent-covered-methods))
-      (when (and (file-exists-p (gnus-agent-lib-file "flags"))
-		 (eq (gnus-server-status gnus-command-method) 'ok))
+      (when (eq (gnus-server-status gnus-command-method) 'ok)
 	(gnus-agent-possibly-synchronize-flags-server gnus-command-method)))))
 
 (defun gnus-agent-synchronize-flags-server (method)
@@ -905,11 +903,13 @@
 
 (defun gnus-agent-possibly-synchronize-flags-server (method)
   "Synchronize flags for server according to `gnus-agent-synchronize-flags'."
-  (when (or (and gnus-agent-synchronize-flags
-		 (not (eq gnus-agent-synchronize-flags 'ask)))
-	    (and (eq gnus-agent-synchronize-flags 'ask)
-		 (gnus-y-or-n-p (format "Synchronize flags on server `%s'? "
-					(cadr method)))))
+  (when (and (file-exists-p (gnus-agent-lib-file "flags"))
+	     (or (and gnus-agent-synchronize-flags
+		      (not (eq gnus-agent-synchronize-flags 'ask)))
+		 (and (eq gnus-agent-synchronize-flags 'ask)
+		      (gnus-y-or-n-p
+		       (format "Synchronize flags on server `%s'? "
+			       (cadr method))))))
     (gnus-agent-synchronize-flags-server method)))
 
 ;;;###autoload
Index: lisp/gnus-int.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-int.el,v
retrieving revision 7.23
diff -u -r7.23 gnus-int.el
--- lisp/gnus-int.el	24 Jan 2007 07:15:37 -0000	7.23
+++ lisp/gnus-int.el	8 Sep 2007 14:42:50 -0000
@@ -36,6 +36,7 @@
 (autoload 'gnus-agent-expire "gnus-agent")
 (autoload 'gnus-agent-regenerate-group "gnus-agent")
 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
+(autoload 'gnus-agent-possibly-synchronize-flags-server "gnus-agent")
 
 (defcustom gnus-open-server-hook nil
   "Hook called just before opening connection to the news server."
@@ -278,6 +279,11 @@
               ;; prompting with "go offline?".  This is only a concern
               ;; when the agent's backend fails to open the server.
               (gnus-open-server gnus-command-method))
+	  (when (and (eq (cadr elem) 'ok) gnus-agent
+		     (gnus-agent-method-p gnus-command-method))
+	    (save-excursion
+	      (gnus-agent-possibly-synchronize-flags-server
+	       gnus-command-method)))
           result)))))
 
 (defun gnus-close-server (gnus-command-method)

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

* Re: [patch] gnus-agent doesn't always synchronise flags if asked to
  2007-09-08 14:54 [patch] gnus-agent doesn't always synchronise flags if asked to Elias Oltmanns
@ 2007-11-09 13:33 ` Elias Oltmanns
  2007-11-24 21:51   ` Reiner Steib
  0 siblings, 1 reply; 5+ messages in thread
From: Elias Oltmanns @ 2007-11-09 13:33 UTC (permalink / raw)
  To: ding

Elias Oltmanns <eo@nebensachen.de> wrote:
> Hi all,
>
> when gnus is switched into plugged mode and any of the agentised servers
> is offline at the time, the user is asked whether to switch that server
> into online mode. However, neither then, nor when gnus actually opens a
> connection to that server (for instance after pressing g in the group
> buffer) flags are synchronised even though gnus-agent-synchronize-flags
> is set to t or 'ask.
>
> I suggest to call gnus-agent-possibly-synchronize-flags from
> gnus-open-server. Please find the patch below.

The ChangeLog entry would be:

* gnus-agent.el (gnus-agent-toggle-plugged): Don't call
gnus-agent-'possibly-synchronize-flags as this should be called when the
server is actually being opened.
Also, move check for the flags file of an agentized server from
g-a-p-synchronize-flags to g-a-p-synchronize-flags-server.

* gnus-int.el (gnus-open-server): Add a call to
gnus-agent-possibly-synchronize-flags-server after a connection has been
established successfully.


Regards,

Elias




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

* Re: [patch] gnus-agent doesn't always synchronise flags if asked to
  2007-11-09 13:33 ` Elias Oltmanns
@ 2007-11-24 21:51   ` Reiner Steib
  2007-11-27 11:46     ` Elias Oltmanns
  0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2007-11-24 21:51 UTC (permalink / raw)
  To: ding

On Fri, Nov 09 2007, Elias Oltmanns wrote:

> Elias Oltmanns <eo@nebensachen.de> wrote:
>> when gnus is switched into plugged mode and any of the agentised servers
>> is offline at the time, the user is asked whether to switch that server
>> into online mode. However, neither then, nor when gnus actually opens a
>> connection to that server (for instance after pressing g in the group
>> buffer) flags are synchronised even though gnus-agent-synchronize-flags
>> is set to t or 'ask.
>>
>> I suggest to call gnus-agent-possibly-synchronize-flags from
>> gnus-open-server. Please find the patch below.
>
> The ChangeLog entry would be: [...]

Thanks.  Installed in the Gnus trunk.  I don't use the agent so I
hesitate to install it in v5-10 (i.e. also Emacs 22.2).  I'd suggest
to install it in v5-10 as well, if nobody reports a problem within a
week or so.  Please feel free to remind us again.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: [patch] gnus-agent doesn't always synchronise flags if asked to
  2007-11-24 21:51   ` Reiner Steib
@ 2007-11-27 11:46     ` Elias Oltmanns
  2007-11-28 20:47       ` Gnus and Emacs branches (was: [patch] gnus-agent doesn't always synchronise flags if asked to) Reiner Steib
  0 siblings, 1 reply; 5+ messages in thread
From: Elias Oltmanns @ 2007-11-27 11:46 UTC (permalink / raw)
  To: ding

Reiner Steib <reinersteib+gmane@imap.cc> wrote:
> On Fri, Nov 09 2007, Elias Oltmanns wrote:
>
>> Elias Oltmanns <eo@nebensachen.de> wrote:
>>> when gnus is switched into plugged mode and any of the agentised servers
>>> is offline at the time, the user is asked whether to switch that server
>>> into online mode. However, neither then, nor when gnus actually opens a
>>> connection to that server (for instance after pressing g in the group
>>> buffer) flags are synchronised even though gnus-agent-synchronize-flags
>>> is set to t or 'ask.
>>>
>>> I suggest to call gnus-agent-possibly-synchronize-flags from
>>> gnus-open-server. Please find the patch below.
>>
>> The ChangeLog entry would be: [...]
>
> Thanks.  Installed in the Gnus trunk.

The ChangeLog entry is there but I fail to see the actual changes in
gnus.el, gnus-int.el gnus-agent.el and gnus-srvr.el.  Did something go
wrong?

> I don't use the agent so I hesitate to install it in v5-10 (i.e. also
> Emacs 22.2). I'd suggest to install it in v5-10 as well, if nobody
> reports a problem within a week or so. Please feel free to remind us
> again.

Unfortunately, I'm far from being a cvs expert.  Is there an easy way to
view diffs between the trunk and the version included in emacs 22.x from
within a gnus checkout?  This way I could try to find out whether the
same problems actually exist in the stable branch as well.

Regards,

Elias




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

* Gnus and Emacs branches (was: [patch] gnus-agent doesn't always synchronise flags if asked to)
  2007-11-27 11:46     ` Elias Oltmanns
@ 2007-11-28 20:47       ` Reiner Steib
  0 siblings, 0 replies; 5+ messages in thread
From: Reiner Steib @ 2007-11-28 20:47 UTC (permalink / raw)
  To: ding

On Tue, Nov 27 2007, Elias Oltmanns wrote:

> The ChangeLog entry is there but I fail to see the actual changes in
> gnus.el, gnus-int.el gnus-agent.el and gnus-srvr.el.  Did something go
> wrong?

Obviously I didn't commit the lisp files, dunno why.  Now done.

> Is there an easy way to view diffs between the trunk and the version
> included in emacs 22.x from within a gnus checkout?  This way I
> could try to find out whether the same problems actually exist in
> the stable branch as well.

With CVS you can only compare branches within the same repository.  In
our case you can compare v5-10 and trunk (cvs.gnus.org) e.g. with...

  cvs diff -r v5-10 -r HEAD lisp/gnus.el

In Emacs, you could do...

  cvs diff -r EMACS_22_BASE -r HEAD lisp/gnus/gnus.el

Note Gnus in the EMACS_22_BASE branch (5.11) is synched with v5-10
(5.10.*), Gnus trunk (No Gnus) is synched with Emacs trunk (Gnus
5.13).  Note that the synching is done only semi-automatically, there
are delays (usually a couple of days, unless Miles is offline for
longer periods).

If you want to do test on the stable branch, you can checkout the
v5-10 branch by adding "-r v5-10" to the usual "cvs checkout" command.

Maybe comparing Emacs and Gnus repositories if possible using Miles'
arch repository.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2007-11-28 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-08 14:54 [patch] gnus-agent doesn't always synchronise flags if asked to Elias Oltmanns
2007-11-09 13:33 ` Elias Oltmanns
2007-11-24 21:51   ` Reiner Steib
2007-11-27 11:46     ` Elias Oltmanns
2007-11-28 20:47       ` Gnus and Emacs branches (was: [patch] gnus-agent doesn't always synchronise flags if asked to) Reiner Steib

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