Gnus development mailing list
 help / color / mirror / Atom feed
From: David Engster <deng@randomsample.de>
To: ding@gnus.org
Subject: Re: Shorter/customized group names?
Date: Thu, 28 May 2009 11:43:07 +0200	[thread overview]
Message-ID: <877i017ec4.fsf@randomsample.de> (raw)
In-Reply-To: <m28wkhalda.fsf@boostpro.com> (David Abrahams's message of "Thu, 28 May 2009 00:42:57 -0400")

David Abrahams <dave@boostpro.com> writes:
> on Wed May 27 2009, David Engster <deng-AT-randomsample.de> wrote:
>> Just a guess, but using %G instead of %g in gnus-group-line-format will
>> probably do what you want.
>
> Well, thanks; it's definitely a start.  I'd like to do better,
> though. I guess I can use a ~(...) clause and hand-code it, but I
> think there are some things I wouldn't be able to do very easily that
> way.  For example, I'm currently seeing:
>
>        233 | gmane.comp.lib.boost.announce
>       3251 | gmane.comp.lib.boost.asio.user

[...]

> which could be made as simple as:
>
>        233 | gmane.comp.lib.boost.announce
>       3251 |  .boost.asio.user

[...]

Well, there's still the possibility to use collapsed group names (see %c
in gnus-group-line-format), but I never used that because then *all*
groups are collapsed; I like your idea much better. You can do that by
using a user-defined function. Put the following into your .gnus:

(defvar DE-format-previous-regexp nil)
(defvar DE-format-collapse-level 2)

(defun gnus-user-format-function-A (arg)
  (let ((group gnus-tmp-qualified-group))
    (if (eq (car gnus-tmp-method) 'nntp)
	(if (and DE-format-previous-regexp
		 (string-match DE-format-previous-regexp group))
	    (concat " ." (match-string 1 group))
	  (setq DE-format-previous-regexp 
		(if (string-match (format "\\(\\([a-z]+\\.\\)\\{%d\\}\\).+"
					  DE-format-collapse-level)
				  group)
		    (concat (regexp-quote (match-string 1 group))
			    "\\(.+\\)")
		  nil))
	  group)
      (setq DE-format-previous-regexp nil)
      group)))


Now just use %uA instead of %G in gnus-group-line-format. You probably
want to use a collapse level of "3" for your example above. Beware that
this may be buggy, but it works for me so far.

Regards,
David



  reply	other threads:[~2009-05-28  9:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 20:02 David Abrahams
2009-05-27 21:57 ` David Engster
2009-05-28  4:42   ` David Abrahams
2009-05-28  9:43     ` David Engster [this message]
2009-05-29 14:51       ` David Abrahams
2009-05-29 16:50         ` David Engster
2009-05-29 18:02           ` David Abrahams
2009-05-29 22:31             ` David Abrahams
2009-05-30 14:46               ` David Engster
2009-06-09 19:22                 ` David Abrahams
2009-07-08 19:17     ` Ted Zlatanov

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=877i017ec4.fsf@randomsample.de \
    --to=deng@randomsample.de \
    --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).