From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: Re: BUG: org-open-file fails with multiple %s in mailcap entry Date: Thu, 3 Jan 2008 12:41:01 +0000 Message-ID: <20080103124101.GE18716@atlantic.linksys.moosehall> References: <20071222123027.GJ13112@atlantic.linksys.moosehall> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JAPNi-0008Vv-I9 for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:41:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JAPNh-0008VG-5U for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:41:06 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAPNh-0008VD-2g for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:41:05 -0500 Received: from mail.beimborn.com ([70.84.38.100]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JAPNg-0008DK-VN for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:41:05 -0500 Received: from mail.beimborn.com (localhost.localdomain [127.0.0.1]) by mail.beimborn.com (8.12.11.20060308/8.12.8) with ESMTP id m03Cf3d9025004 for ; Thu, 3 Jan 2008 06:41:03 -0600 Received: from localhost (localhost [[UNIX: localhost]]) by mail.beimborn.com (8.12.11.20060308/8.12.11/Submit) id m03Cf3Ka024996 for emacs-orgmode@gnu.org; Thu, 3 Jan 2008 12:41:03 GMT Content-Disposition: inline In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list On Thu, Jan 03, 2008 at 01:33:16PM +0100, Carsten Dominik wrote: > On Dec 22, 2007, at 1:30 PM, Adam Spiers wrote: > >The use of format in org-open-file assumes that there will only ever > >be a single '%s' in a mailcap entry: > > > > (cond > > ((and (stringp cmd) (not (string-match "^\\s-*$" cmd))) > > ;; Remove quotes around the file name - we'll use > > shell-quote-argument. > > (if (string-match "['\"]%s['\"]" cmd) > > (setq cmd (replace-match "%s" t t cmd))) > > (setq cmd (format cmd (shell-quote-argument file))) > > > >However this is not necessarily the case, e.g. I have [snipped] > What are you proposing? Simply that every occurrence of '%s' be replaced by the file, not just the first one.