From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9035 invoked by alias); 30 Aug 2013 08:39:47 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17960 Received: (qmail 18102 invoked from network); 30 Aug 2013 08:39:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f5-b7ef66d00000795a-6c-522057ee6442 Date: Fri, 30 Aug 2013 09:29:33 +0100 From: Peter Stephenson To: Phil Pennock , zsh-users@zsh.org Subject: Re: mailcap configuration in zsh can't open .bk files Message-id: <20130830092933.25d4cd24@pwslap01u.europe.root.pri> In-reply-to: <20130830025918.GA35749@redoubt.spodhuis.org> References: <20130830025918.GA35749@redoubt.spodhuis.org> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsVy+t/xa7rvwhWCDH5sF7HYcXIlo8WRaxfZ HJg8rrY9ZvNYdfADUwBTFJdNSmpOZllqkb5dAlfG0TOfGQvOc1Ycv3+KrYHxHHsXIyeHhICJ xMwNE9ggbDGJC/fWA9lcHEICSxkllmyfxA7h9DNJnN//FqyDRUBV4uHWe4wgNpuAocTUTbOB bA4OEQFviZariSBhYQE7ia+nTjKB2LwC9hIda6aD2ZwCVhInF11nBbGFBJoYJXrPSIDY/AL6 Elf/fmKCOMJeYuaVM4wQvYISPybfYwGxmQW0JDZva2KFsOUlNq95yzyBUWAWkrJZSMpmISlb wMi8ilE0tTS5oDgpPddIrzgxt7g0L10vOT93EyMkLL/uYFx6zOoQowAHoxIPb0egfJAQa2JZ cWXuIUYJDmYlEV4BXYUgId6UxMqq1KL8+KLSnNTiQ4xMHJxSDYyzf/xY13HoVUW1jWgVd2Py tluCjSvkQjq4v1qIX+UtvH1Wd+m961zPBTay32bUabxZ9Mj8zq+QaHlO4aeX6/V+GJ9SVH9f 4GzUMcPq8c/fz2Zq7n/QMZ/XgLXvULu03tpvYTKiwi618gtzLQ63n7yx7YLw4Q+bhDVvLM6/ V5f29+qCdTsEQk8osRRnJBpqMRcVJwIAzNKy0SkCAAA= On Thu, 29 Aug 2013 19:59:18 -0700 Phil Pennock wrote: > On 2013-08-30 at 09:12 +0800, vinurs wrote: > > then in zsh, I can open pdf files, but ,when I mv test.pdf to test.pdf.bk, > > It can not be opened. > > I use file --mime-type test.pdf.bk, It shows: > > test.pdf.bk: application/pdf > > The `file` command looks inside the content of a file and uses a complex > set of rules to try to figure out what sort of file it is. > > The normal approach of MIME handling on Unix is to use the filename > extension to figure out the type of file. There are *two* files of > interest: `mailcap` files say what to do with a MIME type, `mime.types` > files say what MIME type should be assumed for a given extension. Hmm... the zsh-mime-setup script is smart enough to get this right if you specify pdf.bk in ~/.mime.types, e.g. application/pdf pdf pdf.bk but unfortunately the main shell isn't: given the suffix alias pdf.bk, it only looks for the .bk suffix, so the MIME handler isn't started. This is probably fixable, although I'm not sure if it's strictly a bug. If you were able to use a special suffix for this case, e.g. pdf_bk, it would all work. pws