Gnus development mailing list
 help / color / mirror / Atom feed
* Where is gnus-simplify-group-name?
@ 2011-10-08  0:47 Dave Abrahams
  2011-10-10  8:23 ` Julien Danjou
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Abrahams @ 2011-10-08  0:47 UTC (permalink / raw)
  To: ding


I was writing some code that opened groups today and I was disturbed to
find that Gnus would do something different if I spelled the same group
in two different ways.  My `gnus-select-method' is

  (nnimap "LocalIMAP" 
          (nnimap-address "localhost") (nnimap-user "dave")
          (nnimap-server-port 9143) (nnimap-stream network))

If I try to open the group as "nnimap+LocalIMAP:INBOX" instead of just
"INBOX", none of what Gnus has remembered about the group applies; it
has to fetch the list of unread articles newly, etc.  So I looked around
for something that would canonicalize group names and didn't find it.  I
ended up writing this, which *seems* to work (although I don't pretend
to know for sure):

  (defun gnus-simplify-group-name (group)
    (gnus-group-prefixed-name
     (gnus-group-real-name group)
     (gnus-group-method group)))

So, to my questions:

1. Surely this functionality exists somewhere and I've overlooked it?

2. If not, don't we need it?

3. Regardless, shouldn't more of gnus' functions do internal
   canonicalization so that handing them group names isn't so risky?

Thanks,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com





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

* Re: Where is gnus-simplify-group-name?
  2011-10-08  0:47 Where is gnus-simplify-group-name? Dave Abrahams
@ 2011-10-10  8:23 ` Julien Danjou
  2011-10-10 22:53   ` Dave Abrahams
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Danjou @ 2011-10-10  8:23 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: ding

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

On Sat, Oct 08 2011, Dave Abrahams wrote:

> I was writing some code that opened groups today and I was disturbed to
> find that Gnus would do something different if I spelled the same group
> in two different ways.  My `gnus-select-method' is
>
>   (nnimap "LocalIMAP" 
>           (nnimap-address "localhost") (nnimap-user "dave")
>           (nnimap-server-port 9143) (nnimap-stream network))

IIUC, this is due to the primary/secondary methods mechanism, which add
a prefix when methods are secondaries.

Last time we spoke about that, the consensus was to remove this
mechanism so there's not two ways of naming groups like you point out.
But we never started doing it mainly because it can be tricky to not no
break working setups.

Maybe that's time to do it.

-- 
Julien Danjou

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Where is gnus-simplify-group-name?
  2011-10-10  8:23 ` Julien Danjou
@ 2011-10-10 22:53   ` Dave Abrahams
  2011-10-11  8:24     ` Julien Danjou
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Abrahams @ 2011-10-10 22:53 UTC (permalink / raw)
  To: ding


on Mon Oct 10 2011, Julien Danjou <julien-AT-danjou.info> wrote:

> On Sat, Oct 08 2011, Dave Abrahams wrote:
>
>> I was writing some code that opened groups today and I was disturbed to
>> find that Gnus would do something different if I spelled the same group
>> in two different ways.  My `gnus-select-method' is
>>
>>   (nnimap "LocalIMAP" 
>>           (nnimap-address "localhost") (nnimap-user "dave")
>>           (nnimap-server-port 9143) (nnimap-stream network))
>
> IIUC, this is due to the primary/secondary methods mechanism, which add
> a prefix when methods are secondaries.
>
> Last time we spoke about that, the consensus was to remove this
> mechanism so there's not two ways of naming groups like you point out.

I think there still will be two ways, as long as we're allowing people
sometimes to type "INBOX" instead of "nnimap+imap.foo.com:INBOX".  And
I think we want to support that, right?

> But we never started doing it mainly because it can be tricky to not
> no break working setups.
>
> Maybe that's time to do it.

Providing the group name normalization function, and using it where it
counts, would be less disruptive.  And I predict you'll want one even if
you do get rid of the primary/secondary distinction.  However, if you're
up for a big rewrite, all I can say is, "go for it!" :-)

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




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

* Re: Where is gnus-simplify-group-name?
  2011-10-10 22:53   ` Dave Abrahams
@ 2011-10-11  8:24     ` Julien Danjou
  2011-10-11 12:16       ` Dave Abrahams
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Danjou @ 2011-10-11  8:24 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: ding

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

On Tue, Oct 11 2011, Dave Abrahams wrote:

> I think there still will be two ways, as long as we're allowing people
> sometimes to type "INBOX" instead of "nnimap+imap.foo.com:INBOX".  And
> I think we want to support that, right?

No. As soon as you got more than one account, "INBOX" can be 2 different
things, so you need to prefix everything.
What you are suggesting is to keep primary/secondary which is something
that confuses all new Gnus users, this is why we decided to remove this
way of doing things.

I don't think there is any point of having just "INBOX" anywhere.

-- 
Julien Danjou

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Where is gnus-simplify-group-name?
  2011-10-11  8:24     ` Julien Danjou
@ 2011-10-11 12:16       ` Dave Abrahams
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Abrahams @ 2011-10-11 12:16 UTC (permalink / raw)
  To: ding


on Tue Oct 11 2011, Julien Danjou <julien-AT-danjou.info> wrote:

> On Tue, Oct 11 2011, Dave Abrahams wrote:
>
>> I think there still will be two ways, as long as we're allowing people
>> sometimes to type "INBOX" instead of "nnimap+imap.foo.com:INBOX".  And
>> I think we want to support that, right?
>
> No. As soon as you got more than one account, "INBOX" can be 2 different
> things, so you need to prefix everything.
> What you are suggesting is to keep primary/secondary which is something
> that confuses all new Gnus users, this is why we decided to remove this
> way of doing things.
>
> I don't think there is any point of having just "INBOX" anywhere.

Well, if you don't have two INBOXes, it's a lot easier just to say
"INBOX."  That said, I understand your argument.  Like I said, if you're
up for a rewrite, please be my guest.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



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

end of thread, other threads:[~2011-10-11 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-08  0:47 Where is gnus-simplify-group-name? Dave Abrahams
2011-10-10  8:23 ` Julien Danjou
2011-10-10 22:53   ` Dave Abrahams
2011-10-11  8:24     ` Julien Danjou
2011-10-11 12:16       ` Dave Abrahams

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