From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: BUG: org-open-file fails with multiple %s in mailcap entry Date: Thu, 3 Jan 2008 13:51:37 +0100 Message-ID: References: <20071222123027.GJ13112@atlantic.linksys.moosehall> <20080103124101.GE18716@atlantic.linksys.moosehall> Mime-Version: 1.0 (Apple Message framework v915) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JAPY1-00072B-9G for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:51:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JAPXy-0006y3-Vv for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:51:44 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAPXy-0006xt-RI for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:51:42 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JAPXy-0001sr-Lo for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:51:42 -0500 Received: by ug-out-1314.google.com with SMTP id a2so3018767ugf.48 for ; Thu, 03 Jan 2008 04:51:41 -0800 (PST) In-Reply-To: <20080103124101.GE18716@atlantic.linksys.moosehall> 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: Adam Spiers Cc: org-mode mailing list On Jan 3, 2008, at 1:41 PM, Adam Spiers wrote: > 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. Done for 5.18, thanks. - Carsten