From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15824 Path: news.gmane.org!not-for-mail From: davidandrewrogers@gmail.com Newsgroups: gmane.emacs.gnus.user Subject: Re: group-line-format and Gmail - stop displaying [Gmail] Date: Mon, 24 Sep 2012 13:25:50 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1348518607 32159 80.91.229.3 (24 Sep 2012 20:30:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2012 20:30:07 +0000 (UTC) Cc: info-gnus-english@gnu.org To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Mon Sep 24 22:30:12 2012 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TGFIB-0003KV-Ku for gegu-info-gnus-english@m.gmane.org; Mon, 24 Sep 2012 22:30:11 +0200 Original-Received: from localhost ([::1]:59237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGFI6-0000yX-9e for gegu-info-gnus-english@m.gmane.org; Mon, 24 Sep 2012 16:30:06 -0400 Original-Received: by 10.66.89.135 with SMTP id bo7mr2913367pab.39.1348518351138; Mon, 24 Sep 2012 13:25:51 -0700 (PDT) Original-Received: by 10.68.233.130 with SMTP id tw2mr3214297pbc.12.1348518351123; Mon, 24 Sep 2012 13:25:51 -0700 (PDT) Original-Path: usenet.stanford.edu!4no9907820pbn.1!news-out.google.com!t10ni7124914pbh.0!nntp.google.com!4no9907818pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.gnus In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=23.16.109.210; posting-account=IasQPgoAAAAH2ZrI0ZE1TeCJ6flhzPK6 Original-NNTP-Posting-Host: 23.16.109.210 User-Agent: G2/1.0 Injection-Date: Mon, 24 Sep 2012 20:25:51 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.gnus:86912 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15824 Archived-At: 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