Gnus development mailing list
 help / color / mirror / Atom feed
* swapping which account is my "primary" select method
@ 2017-11-19  4:03 Ken Raeburn
  2017-11-19 12:11 ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Ken Raeburn @ 2017-11-19  4:03 UTC (permalink / raw)
  To: ding

I’ve recently had a change at work that has resulted in me adding a second email (IMAP) account to my Gnus config, with each account receiving email, though eventually the first, my current gnus-select-method, will be phased out entirely. Basically, right now, I want to change which one is “primary” without losing any data about the accounts or ticked articles or whatever. I’ve also got some nnvirtual groups, which of course means that Gnus has constructed and saved regular expressions to match group names that may or may not include the server names.

Is there a nice, user-friendly way I’m overlooking to swap the “primary” and a secondary select method around, keeping everything working (or even everything but the nnvirtual regexps), and without losing any state?

I’ve considered going through .newsrc.eld, editing group names, changing where server specs are present, rewriting nnvirtual regular expressions, figuring out how to update the .newsrc file, and so on, but given that it’s a one-shot deal, much of the data exists on the IMAP servers, and I have few gmane/gwene groups, I’m seriously wondering if the easiest way might be to delete all the Gnus data and start over, rebuild topics and virtual groups, etc.

Ken


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

* Re: swapping which account is my "primary" select method
  2017-11-19  4:03 swapping which account is my "primary" select method Ken Raeburn
@ 2017-11-19 12:11 ` Adam Sjøgren
  2017-11-20 19:29   ` Ken Raeburn
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2017-11-19 12:11 UTC (permalink / raw)
  To: ding

Ken writes:

> Is there a nice, user-friendly way I’m overlooking to swap the
> “primary” and a secondary select method around, keeping everything
> working (or even everything but the nnvirtual regexps), and without
> losing any state?

I don't think there is.

What I would suggest you consider, is to stop having a primary select
method.

I.e. set gnus-select-method to '(nnnil) [at the point where you don't
need that account any more], and have all your select methods secondary,
and therefore qualified and "equal".

That's what I tell anybody who wants to listen to me¹ to do :-)


  Best regards,

    Adam


¹ https://koldfront.dk/text/gnus-email-tutorial.html#thebasics

-- 
 "Don’t trust common sense when it comes to                   Adam Sjøgren
  statistics; don’t judge a sequence just from a few     asjo@koldfront.dk
  initial numbers; if you have an interesting question,
  post it online and wait for 16 months."




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

* Re: swapping which account is my "primary" select method
  2017-11-19 12:11 ` Adam Sjøgren
@ 2017-11-20 19:29   ` Ken Raeburn
  2017-11-20 19:37     ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Ken Raeburn @ 2017-11-20 19:29 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding


On Nov 19, 2017, at 07:11, Adam Sjøgren <asjo@koldfront.dk> wrote:

> Ken writes:
> 
>> Is there a nice, user-friendly way I’m overlooking to swap the
>> “primary” and a secondary select method around, keeping everything
>> working (or even everything but the nnvirtual regexps), and without
>> losing any state?
> 
> I don't think there is.
> 
> What I would suggest you consider, is to stop having a primary select
> method.

Interesting, thanks! That occurred to me but I wasn’t sure if it would work. Obviously, I overlooked the existence of nnnil. Is there any special status given to “native” groups that I might still care about, or does it all Just Work?

> I.e. set gnus-select-method to '(nnnil) [at the point where you don't
> need that account any more], and have all your select methods secondary,
> and therefore qualified and "equal”.

I kind of like how this matches what I’ve seen in some of the other MUAs I’ve been using recently, though Gnus has quite a way to go before its account configuration is as friendly as some of the others. (Maybe I should put a few ideas on the “Gnus Wish List” emacswiki page. :-) 

Ken


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

* Re: swapping which account is my "primary" select method
  2017-11-20 19:29   ` Ken Raeburn
@ 2017-11-20 19:37     ` Adam Sjøgren
  2017-11-20 19:56       ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2017-11-20 19:37 UTC (permalink / raw)
  To: ding

Ken writes:

> Is there any special status given to “native” groups that I might
> still care about, or does it all Just Work?

Not that I remember, I've been running with '(nnnil) as
primary-select-method for years.

>> I.e. set gnus-select-method to '(nnnil) [at the point where you don't
>> need that account any more], and have all your select methods secondary,
>> and therefore qualified and "equal”.
>
> I kind of like how this matches what I’ve seen in some of the other
> MUAs I’ve been using recently, though Gnus has quite a way to go
> before its account configuration is as friendly as some of the others.

I don't think it is that bad any more - the last run Lars had through it
improved a lot of things, but it was some years ago, so if you have a
bunch of good ideas, let's hear them :-)

> (Maybe I should put a few ideas on the “Gnus Wish List” emacswiki
> page. :-)

Yes! And/or post them here on the mailing list.


  Best regards,

    Adam

-- 
 "Tetris has taught me that your mistakes pile up and         Adam Sjøgren
  your accomplishments disappear."                       asjo@koldfront.dk




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

* Re: swapping which account is my "primary" select method
  2017-11-20 19:37     ` Adam Sjøgren
@ 2017-11-20 19:56       ` Eric Abrahamsen
  2017-11-20 20:35         ` Jorge A. Alfaro-Murillo
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-20 19:56 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Ken writes:
>
>> Is there any special status given to “native” groups that I might
>> still care about, or does it all Just Work?
>
> Not that I remember, I've been running with '(nnnil) as
> primary-select-method for years.

I think the only real difference is that groups belonging to the primary
method show up in the Group buffer *without* their server prefix string.
So:

primary method:
gmane.emacs.gnus.general

secondary method:
news.gmane.org:gmane.emacs.gnus.general

AFAICT, that's the only user-visible difference. I suppose one other
thing is that you can't set the primary method via the Server buffer;
that always has to be defined in your gnus.el file.

>>> I.e. set gnus-select-method to '(nnnil) [at the point where you don't
>>> need that account any more], and have all your select methods secondary,
>>> and therefore qualified and "equal”.
>>
>> I kind of like how this matches what I’ve seen in some of the other
>> MUAs I’ve been using recently, though Gnus has quite a way to go
>> before its account configuration is as friendly as some of the others.
>
> I don't think it is that bad any more - the last run Lars had through it
> improved a lot of things, but it was some years ago, so if you have a
> bunch of good ideas, let's hear them :-)
>
>> (Maybe I should put a few ideas on the “Gnus Wish List” emacswiki
>> page. :-)
>
> Yes! And/or post them here on the mailing list.

Please do both!

Eric




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

* Re: swapping which account is my "primary" select method
  2017-11-20 19:56       ` Eric Abrahamsen
@ 2017-11-20 20:35         ` Jorge A. Alfaro-Murillo
  2017-11-20 20:52           ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2017-11-20 20:35 UTC (permalink / raw)
  To: ding

Eric Abrahamsen writes:

> asjo@koldfront.dk (Adam Sjøgren) writes: 
> 
>> Ken writes: 
>> 
>>> Is there any special status given to “native” groups that I 
>>> might still care about, or does it all Just Work? 
>> 
>> Not that I remember, I've been running with '(nnnil) as 
>> primary-select-method for years. 
> 
> I think the only real difference is that groups belonging to the 
> primary method show up in the Group buffer *without* their 
> server prefix string.  So: 
> 
> primary method:
> gmane.emacs.gnus.general
> 
> secondary method:
> news.gmane.org:gmane.emacs.gnus.general
> 
> AFAICT, that's the only user-visible difference. 

That annoyed me quite a bit so I dealt with it by creating a file 
with the substitutions of the names that I want separated by 
semicolons, for example

#+BEGIN_EXAMPLE
  nimap+gmail:[Gmail]/All Mail;All mail
  news.gmane.org:gmane.emacs.gnus.general;gnus
  news.gmane.org:gwene.org.emacsen.planet;Planet Emacsen
#+END_EXAMPLE

And the following code:

#+BEGIN_SRC emacs-lisp
  (setq gnus-group-line-format "%M%S%p%P%5y:%B%(%uG%)\n")

  (defun gnus-user-format-function-G (arg)
    (let ((mapped-name (assoc gnus-tmp-group 
    jaam/group-name-map)))
      (if (null mapped-name)
          gnus-tmp-group
       (cdr mapped-name))))

  (eval-after-load "gnus"
    '(defcustom jaam/group-name-map-file
       (nnheader-concat gnus-home-directory 
       "~/.group-name-map-file")
       "File with entries for `jaam/group-name-map'. Each mapping
    should be in one separate line with the real name of the group
    a semicolon and the alias name of the group."))
    
  (defun jaam/update-group-name-map ()
    (with-temp-buffer
      (insert-file-contents jaam/group-name-map-file)
      (setq jaam/group-name-map
        (mapcar (lambda (x)
                  (let ((entries (split-string x ";")))
                       (cons (car entries) (cadr entries))))
                (split-string (buffer-string) "[\n]+")))))

  (eval-after-load "gnus"
    '(jaam/update-group-name-map))
#+END_SRC

Best,
-- 
Jorge.




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

* Re: swapping which account is my "primary" select method
  2017-11-20 20:35         ` Jorge A. Alfaro-Murillo
@ 2017-11-20 20:52           ` Eric Abrahamsen
  2017-11-20 23:09             ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-20 20:52 UTC (permalink / raw)
  To: ding

jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes:

> Eric Abrahamsen writes:
>
>> asjo@koldfront.dk (Adam Sjøgren) writes: 
>> 
>>> Ken writes: 
>>> 
>>>> Is there any special status given to “native” groups that I 
>>>> might still care about, or does it all Just Work? 
>>> 
>>> Not that I remember, I've been running with '(nnnil) as 
>>> primary-select-method for years. 
>> 
>> I think the only real difference is that groups belonging to the 
>> primary method show up in the Group buffer *without* their 
>> server prefix string.  So: 
>> 
>> primary method:
>> gmane.emacs.gnus.general
>> 
>> secondary method:
>> news.gmane.org:gmane.emacs.gnus.general
>> 
>> AFAICT, that's the only user-visible difference. 
>
> That annoyed me quite a bit so I dealt with it by creating a file 
> with the substitutions of the names that I want separated by 
> semicolons, for example

That must have *really* annoyed you :)

I think it would be a good idea to allow a user-settable group name
alias, as one of the group parameters.

Eric




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

* Re: swapping which account is my "primary" select method
  2017-11-20 20:52           ` Eric Abrahamsen
@ 2017-11-20 23:09             ` Andreas Schwab
  2017-11-20 23:54               ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2017-11-20 23:09 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

On Nov 20 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> I think it would be a good idea to allow a user-settable group name
> alias, as one of the group parameters.

You can shorten the name by using nntp-address explicitly in the select
method:

  (nntp "gmane" (nntp-address "news.gmane.org"))

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: swapping which account is my "primary" select method
  2017-11-20 23:09             ` Andreas Schwab
@ 2017-11-20 23:54               ` Eric Abrahamsen
  2017-11-21 16:32                 ` Reiner Steib
  0 siblings, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-20 23:54 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Nov 20 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> I think it would be a good idea to allow a user-settable group name
>> alias, as one of the group parameters.
>
> You can shorten the name by using nntp-address explicitly in the select
> method:
>
>   (nntp "gmane" (nntp-address "news.gmane.org"))

Good point! I had forgotten that. Still, a group alias would be useful.




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

* Re: swapping which account is my "primary" select method
  2017-11-20 23:54               ` Eric Abrahamsen
@ 2017-11-21 16:32                 ` Reiner Steib
  2017-11-21 19:10                   ` Eric Abrahamsen
  0 siblings, 1 reply; 11+ messages in thread
From: Reiner Steib @ 2017-11-21 16:32 UTC (permalink / raw)
  To: ding

On Mo, Nov 20 2017, Eric Abrahamsen wrote:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> On Nov 20 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>>
>>> I think it would be a good idea to allow a user-settable group name
>>> alias, as one of the group parameters.
>>
>> You can shorten the name by using nntp-address explicitly in the select
>> method:
>>
>>   (nntp "gmane" (nntp-address "news.gmane.org"))
>
> Good point! I had forgotten that. Still, a group alias would be useful.

,----[ (info "(gnus)Group Line Specification") ]
| ‘C’
|      Group comment (*note Group Parameters::) or group name if there is
|      no comment element in the group parameters.
`----

Bye, Reiner.




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

* Re: swapping which account is my "primary" select method
  2017-11-21 16:32                 ` Reiner Steib
@ 2017-11-21 19:10                   ` Eric Abrahamsen
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Abrahamsen @ 2017-11-21 19:10 UTC (permalink / raw)
  To: ding

Reiner Steib <reiner.steib+gmane-2017@gmail.com> writes:

> On Mo, Nov 20 2017, Eric Abrahamsen wrote:
>
>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>
>>> On Nov 20 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>>>
>>>> I think it would be a good idea to allow a user-settable group name
>>>> alias, as one of the group parameters.
>>>
>>> You can shorten the name by using nntp-address explicitly in the select
>>> method:
>>>
>>>   (nntp "gmane" (nntp-address "news.gmane.org"))
>>
>> Good point! I had forgotten that. Still, a group alias would be useful.
>
> ,----[ (info "(gnus)Group Line Specification") ]
> | ‘C’
> |      Group comment (*note Group Parameters::) or group name if there is
> |      no comment element in the group parameters.
> `----

And of course, Gnus can already do it.




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

end of thread, other threads:[~2017-11-21 19:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19  4:03 swapping which account is my "primary" select method Ken Raeburn
2017-11-19 12:11 ` Adam Sjøgren
2017-11-20 19:29   ` Ken Raeburn
2017-11-20 19:37     ` Adam Sjøgren
2017-11-20 19:56       ` Eric Abrahamsen
2017-11-20 20:35         ` Jorge A. Alfaro-Murillo
2017-11-20 20:52           ` Eric Abrahamsen
2017-11-20 23:09             ` Andreas Schwab
2017-11-20 23:54               ` Eric Abrahamsen
2017-11-21 16:32                 ` Reiner Steib
2017-11-21 19:10                   ` Eric Abrahamsen

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