Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: davidandrewrogers@gmail.com
To: info-gnus-english@gnu.org
Cc: info-gnus-english@gnu.org
Subject: Re: group-line-format and Gmail - stop displaying [Gmail]
Date: Mon, 24 Sep 2012 13:25:50 -0700 (PDT)	[thread overview]
Message-ID: <d055b9e6-48ae-4248-a4b7-8970a90421e1@googlegroups.com> (raw)
In-Reply-To: <mailman.9667.1348512549.855.info-gnus-english@gnu.org>

On Monday, September 24, 2012 11:49:10 AM UTC-7, Kevin Brubeck Unhammer wrote:
> davidandrewrogers writes:
> 
> 
> 
> > Hi all
> 
> > I use Gnus for email only.
> 
> >
> 
> > To make small-screen usage easier, I'd like to get my Gnus group line
> 
> > to omit the square-bracketed word [Gmail]/ from the display.
> 
> >
> 
> > I currently have
> 
> >
> 
> > (setq gnus-group-line-format "%M%S%p%P%5y: %(%G%)%l %6,6~(cut 2)d\n")
> 
> >
> 
> > but I can't find any clues about how to convert the group name (the %G
> 
> > above) into something that will eliminate the relevant (I mean
> 
> > irrelevant) :) part.
> 
> 
> 
> Perhaps something like the following (totally untested):
> 
> 
> 
>     (defun gnus-user-format-function-G (arg)
> 
>       (replace-regexp-in-string
> 
>       "\\[Gmail\\]"
> 
>       ""
> 
>        gnus-tmp-group))
> 
>     (setq gnus-group-line-format "%M%S%p%P%5y: %(%uG%)%l %6,6~(cut 2)d\n")
> 
> 
> 
> Note the use of %uG (see C-h v gnus-group-line-format).


Thanks! That basically worked for me. After fiddling with the regex a little bit to compensate for the fact that the original %G gave the simple group name and not the full group name, here's what I've come up with for my situation:

    (defun gnus-user-format-function-G (arg)
      (replace-regexp-in-string
      "^.*[:/]"
      ""
       gnus-tmp-group))
    (setq gnus-group-line-format "%M%S%p%P%5y: %(%uG%)%l %6,6~(cut 2)d\n")

The new regex says (I hope it says!) "Match the colon or the slash and everything before it".

Again, thanks for the help.

-- 
David

  parent reply	other threads:[~2012-09-24 20:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 14:55 davidandrewrogers
2012-09-24 18:48 ` Kevin Brubeck Unhammer
     [not found] ` <mailman.9667.1348512549.855.info-gnus-english@gnu.org>
2012-09-24 20:25   ` davidandrewrogers [this message]
2012-09-24 22:14     ` davidandrewrogers

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=d055b9e6-48ae-4248-a4b7-8970a90421e1@googlegroups.com \
    --to=davidandrewrogers@gmail.com \
    --cc=info-gnus-english@gnu.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).