From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/32348 Path: main.gmane.org!not-for-mail From: dme@dme.org Newsgroups: gmane.emacs.gnus.general Subject: patch: support '/' in group shortening Date: 07 Sep 2000 09:47:09 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035168633 19237 80.91.224.250 (21 Oct 2002 02:50:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:50:33 +0000 (UTC) Return-Path: Original-Received: from fisher.math.uh.edu (fisher.math.uh.edu [129.7.128.35]) by mailhost.sclp.com (Postfix) with ESMTP id 8A462D051E for ; Thu, 7 Sep 2000 04:51:07 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by fisher.math.uh.edu (8.9.1/8.9.1) with ESMTP id DAC03752; Thu, 7 Sep 2000 03:47:33 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 07 Sep 2000 03:46:26 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id DAA16984 for ; Thu, 7 Sep 2000 03:46:10 -0500 (CDT) Original-Received: from serafina-pekkala.dme.org (something.dme.org [212.240.232.120]) by mailhost.sclp.com (Postfix) with ESMTP id A5E00D051E for ; Thu, 7 Sep 2000 04:46:33 -0400 (EDT) Original-Received: (from dme@localhost) by serafina-pekkala.dme.org (8.9.3/8.9.3) id JAA10550; Thu, 7 Sep 2000 09:47:10 +0100 Original-To: ding@gnus.org Original-Lines: 10 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Acadia) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:32348 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:32348 --=-=-= Our MS Exchange server uses '/' as a path separator (as opposed to '.'). This patch attempts to make gnus-short-group-name guess which is in use and flatten the name accordingly. Apologies if my elisp is poor. --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=pa Content-Description: patch: support '/' in group shortening *** gnus.el 2000/08/21 13:49:24 5.142 --- gnus.el 2000/09/06 08:43:52 *************** *** 2663,2671 **** group (substring group (+ 1 colon)))) (setq foreign (concat foreign ":"))) ;; Collapse group name leaving LEVELS uncollapsed elements ! (let* ((glist (split-string group "\\.")) ! (glen (length glist)) res) (setq levels (- glen levels)) (dolist (g glist) (push (if (>= (decf levels) 0) --- 2664,2684 ---- group (substring group (+ 1 colon)))) (setq foreign (concat foreign ":"))) ;; Collapse group name leaving LEVELS uncollapsed elements ! (let* ((slist (split-string group "/")) ! (slen (length slist)) ! (dlist (split-string group "\\.")) ! (dlen (length dlist)) ! glist ! glen ! gsep res) + (if (> slen dlen) + (setq glist slist + glen slen + gsep "/") + (setq glist dlist + glen dlen + gsep ".")) (setq levels (- glen levels)) (dolist (g glist) (push (if (>= (decf levels) 0) *************** *** 2674,2680 **** (substring g 0 1)) g) res)) ! (concat foreign (mapconcat 'identity (nreverse res) ".")))))) (defun gnus-narrow-to-body () "Narrow to the body of an article." --- 2687,2693 ---- (substring g 0 1)) g) res)) ! (concat foreign (mapconcat 'identity (nreverse res) gsep)))))) (defun gnus-narrow-to-body () "Narrow to the body of an article." --=-=-= dme. --=-=-=--