Gnus development mailing list
 help / color / mirror / Atom feed
* bug in gnus-group-kill-group; smarter gnus-find-method-for-group
@ 2006-06-20 20:59 Andreas Seltenreich
  2006-06-25 10:47 ` Andreas Seltenreich
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Seltenreich @ 2006-06-20 20:59 UTC (permalink / raw)


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

I just found out why groups I killed using gnus-group-kill-group from
a secondary nnml server kept reappearing when I hit
gnus-group-find-new-groups in the group buffer.  It turned out
gnus-group-change-level didn't put them into gnus-killed-list.

This is because it calls gnus-group-foreign-p after removing the
group's entry from gnus-active-hashtb.  gnus-group-foreign-p uses
gnus-find-method-for-group on the group name, which currently invents
a new method if it can't find an entry in gnus-active-hashtb, ignoring
a possibly existing definition for the virtual server name used.

To fix it, I propose the following patch to make
gnus-find-method-for-group smarter when presented with an unknown
group, and only invent a new method as a last resort.


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

Index: gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 7.54
diff -c -r7.54 gnus.el
*** gnus.el	1 May 2006 15:14:44 -0000	7.54
--- gnus.el	20 Jun 2006 20:18:58 -0000
***************
*** 4123,4130 ****
    (or gnus-override-method
        (and (not group)
  	   gnus-select-method)
!       (and (not (gnus-group-entry group)) ;; a new group
! 	   (gnus-group-name-to-method group))
        (let ((info (or info (gnus-get-info group)))
  	    method)
  	(if (or (not info)
--- 4123,4135 ----
    (or gnus-override-method
        (and (not group)
  	   gnus-select-method)
!       (and (not (gnus-group-entry group))
! 	   ;; Killed or otherwise unknown group.
! 	   (or
! 	    ;; If we know a virtual server by that name, return its method.
! 	    (gnus-server-to-method (gnus-group-server group))
! 	    ;; Invent a new method as last resort.
! 	    (gnus-group-name-to-method group)))
        (let ((info (or info (gnus-get-info group)))
  	    method)
  	(if (or (not info)

[-- Attachment #3: Type: text/plain, Size: 207 bytes --]


Note that this change would also have prevented the method cache
corruption problem with nnir.el (which has been worked around using
gnus-override-method).

Any objections to applying it?

regards,
andreas

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

* Re: bug in gnus-group-kill-group; smarter gnus-find-method-for-group
  2006-06-20 20:59 bug in gnus-group-kill-group; smarter gnus-find-method-for-group Andreas Seltenreich
@ 2006-06-25 10:47 ` Andreas Seltenreich
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Seltenreich @ 2006-06-25 10:47 UTC (permalink / raw)


Andreas Seltenreich writes:

> Any objections to applying it?

I've committed the change to gnus-find-method-for-group to the trunk.
Putting a (debug) in the new code revealed some more places where the
function is called on killed/unknown groups, and the caller didn't
expect an all-new method.  So, changing g-f-m-f-g fixes at least the
following bugs:

* gnus-group-secondary-p/gnus-group-foreign-p returning false-negative
  when called on unknown/killed groups, as done by
  gnus-group-change-level and gnus-group-read-ephemeral-group.

* gnus-server-method-cache corruption when renaming groups (through
  gnus-agent-rename-group, but affecting all groups, even if the agent
  is disabled).

* gnus-group-name-charset being schizophrenic when
  gnus-group-name-charset-method-alist is used (E.g., creating groups
  using a different encoding than the one used to access them later).

I've also had to massage gnus-group-server a bit, so that it is up for
the new job in gnus-find-method-for-group.

Btw: Is there a reason gnus-group-server is a defmacro instead of a
defsubst?

regards,
andreas



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

end of thread, other threads:[~2006-06-25 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 20:59 bug in gnus-group-kill-group; smarter gnus-find-method-for-group Andreas Seltenreich
2006-06-25 10:47 ` Andreas Seltenreich

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