From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20560 invoked from network); 25 Oct 2005 22:45:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Oct 2005 22:45:53 -0000 Received: (qmail 48741 invoked from network); 25 Oct 2005 22:45:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Oct 2005 22:45:47 -0000 Received: (qmail 22938 invoked by alias); 25 Oct 2005 22:45:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21935 Received: (qmail 22928 invoked from network); 25 Oct 2005 22:45:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Oct 2005 22:45:43 -0000 Received: (qmail 48460 invoked from network); 25 Oct 2005 22:45:43 -0000 Received: from mta09-winn.ispmail.ntl.com (81.103.221.49) by a.mx.sunsite.dk with SMTP; 25 Oct 2005 22:45:41 -0000 Received: from aamta12-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20051025224541.FYMU8609.mta09-winn.ispmail.ntl.com@aamta12-winn.ispmail.ntl.com>; Tue, 25 Oct 2005 23:45:41 +0100 Received: from pwslaptop.csr.com ([81.105.238.64]) by aamta12-winn.ispmail.ntl.com with SMTP id <20051025224540.TWUU10626.aamta12-winn.ispmail.ntl.com@pwslaptop.csr.com>; Tue, 25 Oct 2005 23:45:40 +0100 Date: Tue, 25 Oct 2005 23:45:26 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk, ramk@cse.iitm.ernet.in, 335190-forwarded@bugs.debian.org Subject: Re: [ramk@cse.iitm.ernet.in: Bug#335190: zsh: Enhancements to zsh-mime-handler] Message-Id: <20051025234526.4f7402be.p.w.stephenson@ntlworld.com> In-Reply-To: <20051024193318.GB10982@scowler.net> References: <20051024193318.GB10982@scowler.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Mon, 24 Oct 2005 15:33:18 -0400 Clint Adams wrote: > ----- Forwarded message from "R.Ramkumar" ----- > > Just felt that there is much scope for customization in > zsh-mime-{handler,setup}. I have patched the files for the following > enhancements (thought that the additions were too small to merit > reporting them individually, so I am putting them together): Thanks, I'll add these. Here's some proposed documentation (styles now put in alphabetical order). It would be quite nice to have a couple of examples illustrating mailcap-prio-flags. Index: Doc/Zsh/contrib.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/contrib.yo,v retrieving revision 1.51 diff -u -r1.51 contrib.yo --- Doc/Zsh/contrib.yo 21 Oct 2005 09:51:55 -0000 1.51 +++ Doc/Zsh/contrib.yo 25 Oct 2005 22:43:22 -0000 @@ -1370,19 +1370,17 @@ to style patterns in case the system is extended in future. Some examples are given below. startitem() -item(mime-types)( -A list of files in the format of tt(~/.mime.types) and -tt(/etc/mime.types) to be read during setup, replacing the default list -which consists of those two files. The context is tt(:mime:). -A tt(PLUS()) in the list will be replaced by the default files. +item(tt(current-shell))( +If this boolean style is true, the mailcap handler for the context in +question is run using the tt(eval) builtin instead of by starting a new +tt(sh) process. This is more efficient, but may not work in the occasional +cases where the mailcap handler uses strict POSIX syntax. ) -item(mailcap)( -A list of files in the format of tt(~/.mailcap) and -tt(/etc/mailcap) to be read during setup, replacing the default list -which consists of those two files. The context is tt(:mime:). -A tt(PLUS()) in the list will be replaced by the default files. +item(tt(flags))( +Defines flags to go with a handler; the context is as for the +tt(handler) style, and the format is as for the flags in tt(mailcap). ) -item(handler)( +item(tt(handler))( Specifies a handler for a suffix; the suffix is given by the context as tt(:mime:.)var(suffix)tt(:), and the format of the handler is exactly that in tt(mailcap). Note in particular the `tt(.)' and trailing colon @@ -1392,11 +1390,63 @@ or if the output is to be displayed through a pager (but not if the handler is itself a pager), it should include tt(copiousoutput). ) -item(flags)( -Defines flags to go with a handler; the context is as for the -tt(handler) style, and the format is as for the flags in tt(mailcap). +item(tt(mailcap))( +A list of files in the format of tt(~/.mailcap) and +tt(/etc/mailcap) to be read during setup, replacing the default list +which consists of those two files. The context is tt(:mime:). +A tt(PLUS()) in the list will be replaced by the default files. +) +item(tt(mailcap-priorities))( +This style is used to resolve multiple mailcap entries for the same MIME +type. It consists of an array of the following elements, in descending +order of priority; later entries will be used if earlier entries are +unable to resolve the entries being compared. If none of the tests +resolve the entries, the first entry encountered is retained. + +startitem() +item(tt(files))( +The order of files (entries in the tt(mailcap) style) read. Earlier +files are preferred. (Note this does not resolve entries in the same file.) +) +item(tt(priority))( +The priority flag from the mailcap entry. The priority is an integer +from 0 to 9 with the default value being 5. +) +item(tt(flags))( +The test given by the tt(mailcap-prio-flags) option is used to resolve +entries. +) +item(tt(place))( +Later entries are preferred; as the entries are strictly ordered, this +test always succeeds. +) +enditem() + +Note that as this style is handled during initialisation, the context +is always tt(:mime:), with no discrimination by suffix. +) +item(tt(mailcap-prio-flags))( +This style is used when the keyword tt(flags) is encountered in the +list of tests specified by the tt(mailcap-priorities) style. +It should be set to a list of patterns, each of which is tested against +the flags specified in the mailcap entry (in other words, the sets of +assignments found with some entries in the mailcap file). Earlier +patterns in the list are preferred to later ones, and matched patterns +are preferred to unmatched ones. ) -item(pager)( +item(tt(mime-types))( +A list of files in the format of tt(~/.mime.types) and +tt(/etc/mime.types) to be read during setup, replacing the default list +which consists of those two files. The context is tt(:mime:). +A tt(PLUS()) in the list will be replaced by the default files. +) +item(tt(never-background))( +If this boolean style is set, the handler for the given context is +always run in the foreground, even if the flags provided in the mailcap +entry suggest it need not be (for example, it doesnʼt require a +terminal). +) +item(tt(pager))( If set, will be used instead of tt($PAGER) or tt(more) to handle suffixes where the tt(copiousoutput) flag is set. The context is as for tt(handler), i.e. tt(:mime:.)var(suffix)tt(:) for handling