Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* group-line-format and Gmail - stop displaying [Gmail]
@ 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>
  0 siblings, 2 replies; 4+ messages in thread
From: davidandrewrogers @ 2012-09-24 14:55 UTC (permalink / raw)
  To: info-gnus-english

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.

Even getting my group-line to not display "a set of square brackets and anything inside them" would be good enough, I expect - I don't have any other mailboxes with those as part of the name.

-- 
Thanks
David

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

* Re: group-line-format and Gmail - stop displaying [Gmail]
  2012-09-24 14:55 group-line-format and Gmail - stop displaying [Gmail] davidandrewrogers
@ 2012-09-24 18:48 ` Kevin Brubeck Unhammer
       [not found] ` <mailman.9667.1348512549.855.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Brubeck Unhammer @ 2012-09-24 18:48 UTC (permalink / raw)
  To: info-gnus-english

davidandrewrogers@gmail.com 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).

-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C

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

* Re: group-line-format and Gmail - stop displaying [Gmail]
       [not found] ` <mailman.9667.1348512549.855.info-gnus-english@gnu.org>
@ 2012-09-24 20:25   ` davidandrewrogers
  2012-09-24 22:14     ` davidandrewrogers
  0 siblings, 1 reply; 4+ messages in thread
From: davidandrewrogers @ 2012-09-24 20:25 UTC (permalink / raw)
  To: info-gnus-english; +Cc: info-gnus-english

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

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

* Re: group-line-format and Gmail - stop displaying [Gmail]
  2012-09-24 20:25   ` davidandrewrogers
@ 2012-09-24 22:14     ` davidandrewrogers
  0 siblings, 0 replies; 4+ messages in thread
From: davidandrewrogers @ 2012-09-24 22:14 UTC (permalink / raw)
  To: info-gnus-english; +Cc: info-gnus-english

Actually, the following is even nicer for me; it prepends the initial letter of the server name onto each mailbox name, thus visually identifying which INBOX of several is listed (rashly assuming that each server's name begins with a different letter). The result is something like g_INBOX.


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

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

end of thread, other threads:[~2012-09-24 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-24 14:55 group-line-format and Gmail - stop displaying [Gmail] 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
2012-09-24 22:14     ` davidandrewrogers

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