Gnus development mailing list
 help / color / mirror / Atom feed
From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: ding@gnus.org
Subject: Re: swapping which account is my "primary" select method
Date: Mon, 20 Nov 2017 15:35:42 -0500	[thread overview]
Message-ID: <874lpoeli9.fsf@yale.edu> (raw)
In-Reply-To: <87d14c207n.fsf@ericabrahamsen.net>

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.




  reply	other threads:[~2017-11-20 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19  4:03 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lpoeli9.fsf@yale.edu \
    --to=jorge.alfaro-murillo@yale.edu \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).