From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68569 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.gnus.general Subject: Re: Shorter/customized group names? Date: Thu, 28 May 2009 11:43:07 +0200 Message-ID: <877i017ec4.fsf@randomsample.de> References: <87zlcydxa0.fsf@randomsample.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1243503856 6093 80.91.229.12 (28 May 2009 09:44:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 May 2009 09:44:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M17000@lists.math.uh.edu Thu May 28 11:44:12 2009 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1M9c9h-00048W-2c for ding-account@gmane.org; Thu, 28 May 2009 11:44:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1M9c8r-0002fU-VQ; Thu, 28 May 2009 04:43:18 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1M9c8p-0002fE-O6 for ding@lists.math.uh.edu; Thu, 28 May 2009 04:43:15 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1M9c8j-0002Al-Jy for ding@lists.math.uh.edu; Thu, 28 May 2009 04:43:15 -0500 Original-Received: from m61s02.vlinux.de ([83.151.21.164]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1M9c9D-0003xv-00 for ; Thu, 28 May 2009 11:43:39 +0200 Original-Received: from dslc-082-082-177-108.pools.arcor-ip.net ([82.82.177.108] helo=honk) by m61s02.vlinux.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1M9c8i-0000zb-4f for ding@gnus.org; Thu, 28 May 2009 11:43:08 +0200 In-Reply-To: (David Abrahams's message of "Thu, 28 May 2009 00:42:57 -0400") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.93 (gnu/linux) Mail-Copies-To: never Mail-Followup-To: ding@gnus.org X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68569 Archived-At: David Abrahams writes: > on Wed May 27 2009, David Engster 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