From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5054 Path: main.gmane.org!not-for-mail From: jvinson@cheux.ecs.umass.edu (Jack Vinson) Newsgroups: gmane.emacs.gnus.general Subject: shortening group names Date: 05 Feb 1996 16:44:50 -0500 Organization: University of Massachusetts Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035145711 31640 80.91.224.250 (20 Oct 2002 20:28:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:28:31 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from biggulp.callamer.com (root@biggulp.callamer.com [199.74.141.2]) by miranova.com (8.7.3/8.6.9) with SMTP id OAA10186 for ; Mon, 5 Feb 1996 14:48:26 -0800 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by biggulp.callamer.com (8.6.12/8.6.9-callamer-rdw080995) with ESMTP id OAA07830 for ; Mon, 5 Feb 1996 14:47:57 -0800 Original-Received: from cheux.ecs.umass.edu (cheux.ecs.umass.edu [128.119.82.11]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 5 Feb 1996 22:51:18 +0100 Original-Received: by cheux.ecs.umass.edu (5.65/DEC-Ultrix/4.3) id AA23036; Mon, 5 Feb 1996 16:45:13 -0500 Original-To: ding@ifi.uio.no Original-Lines: 44 Xref: main.gmane.org gmane.emacs.gnus.general:5054 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5054 This is a revision of the function I posted earlier for shortening group names down to a given length. The previous version relied on "group" being set in the function gnus-group-insert-group-line. It now uses the global temporary variable gnus-tmp-group for the group name. Does anyone know if the length parameter from the format spec gets stuck in a gnus-tmp-* variable? I don't see any likely candidates. I have this set up to use the %uc format specifier. This was done as an alternative to using %g which contracts all but the deepest element of the group name. This will contract elements until the group name is not greater than jmv-gnus-short-group-name-length. This works in sgnus-0.35 and will work in 0.36 as well. ;; My functions for shortening the Group name (defvar jmv-gnus-short-group-name-length 30 "Maximum length of shortened newsgroup name. Gnus will abbreviate group name components until this length or less.") (defun gnus-user-format-function-c (group-tmp) "Collapse GROUP name down to jmv-gnus-short-group-name-length." (if (> (length gnus-tmp-group) jmv-gnus-short-group-name-length) (let* ((group gnus-tmp-group) (name "") (foreign "") (depth 0) (skip 1) ) (if (string-match ":" group) (setq foreign (substring group 0 (match-end 0)) group (substring group (match-end 0)))) (while group (if (and (> (+ (length name) (length group)) jmv-gnus-short-group-name-length) (string-match "\\." group)) (setq name (concat name (substring group 0 1)) group (substring group (match-end 0)) name (concat name ".")) (setq name (concat foreign name group) group nil))) name) gnus-tmp-group) ) -- Jonathan "Jack" Vinson jvinson@cheux.ecs.umass.edu Sunderland, MA "Churchill was a shopping bag" - Fatima Mansions