From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/29237 Path: main.gmane.org!not-for-mail From: David Kagedal Newsgroups: gmane.emacs.gnus.general Subject: Re: IMAP server hierarchy as topics Date: 15 Feb 2000 15:32:31 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035165942 1580 80.91.224.250 (21 Oct 2002 02:05:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:05:42 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 622D8D0520 for ; Tue, 15 Feb 2000 09:31:37 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id IAB01657; Tue, 15 Feb 2000 08:31:32 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 15 Feb 2000 08:30:33 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id IAA01236 for ; Tue, 15 Feb 2000 08:30:22 -0600 (CST) Original-Received: from mail.idasys.se (mail.idasys.se [194.218.15.7]) by mailhost.sclp.com (Postfix) with ESMTP id 5BF41D0520 for ; Tue, 15 Feb 2000 09:30:26 -0500 (EST) Original-Received: from walt.idasys.se (walt.idasys.se [194.218.15.100]) by mail.idasys.se (8.8.8/8.8.8) with ESMTP id PAA18244; Tue, 15 Feb 2000 15:46:39 +0100 Original-Received: from shs4.idasys.se ([194.218.15.168]) by walt.idasys.se with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 1S7AY769; Tue, 15 Feb 2000 15:36:01 +0100 Original-To: ding@gnus.org In-Reply-To: Steinar Bang's message of "14 Feb 2000 17:37:12 +0100" Original-Lines: 64 User-Agent: Gnus/5.0804 (Gnus v5.8.4) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:29237 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:29237 Steinar Bang writes: > >>>>> David Kagedal : >=20 > > Steinar Bang writes: > >> * make it possible to set a directory prefix for each IMAP server. > >> This will make mail group names shorter when using the UoW imapd >=20 > > Even better: >=20 > > * Make it possible to duplicate the IMAP folder hierarchy with Gnus > > topics, and only showing the last part of the group names, since = the > > full folder name (minus the root prefix) is available as the topic > > path. >=20 > On closer thought, the two requirements are separate. >=20 > My requirment is to make nnimap work better with UoW imapd, running o= n=20 > a machine where the users' home directories are used for other things > than mail. >=20 > You would wish to set the directory prefix for a UoW imapd, even when > you're presenting the IMAP folder hierarchy as topics (unless you wis= h=20 > to browse your entire home directory as mail folders... which I guess > is possible, however I don't) In a flash of inspiration, I decided to implement your first idea, remove a prefix from the group names. I have used %G in gnus-group-line-format, which would make all my group names, exept for INBOX, start with "mail/". An nnimap method does not really specify a prefix, but a list pattern. So I decided that I needed to add the prefix to strip to the method information. This is what I use: (defconst lysator-imap-method '(nnimap "lysator" (nnimap-address "imap.lysator.liu.se") (nnimap-list-pattern ("INBOX" "mail/*")) (prefix "mail/")))=20=20 I implemented a user format function, and use %uG instead of %G. (setq gnus-group-line-format "%m%M%S%p%5y: %(%uG%)\n") The function does one more trick; if the group parameters contains a 'name parameter, its value is used instead. (defun gnus-user-format-function-G (arg) (let ((name (gnus-group-find-parameter gnus-tmp-group 'name))) (if name name (let ((prefix (assq 'prefix (cddr gnus-tmp-method)))) (if (and prefix (string-match (concat "^\\(" (regexp-quote (cadr prefix)) "\\)") gnus-tmp-qualified-group)) (substring gnus-tmp-qualified-group (match-end 1)) gnus-tmp-qualified-group)))))) --=20 David K=E5gedal