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:33:16 +0100 Message-ID: References: <20071222123027.GJ13112@atlantic.linksys.moosehall> Mime-Version: 1.0 (Apple Message framework v915) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JAPGG-0007pw-5P for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:33:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JAPGD-0007n6-VR for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:33:23 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAPGD-0007n0-QW for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:33:21 -0500 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JAPGD-0006lp-Mn for emacs-orgmode@gnu.org; Thu, 03 Jan 2008 07:33:21 -0500 Received: by ug-out-1314.google.com with SMTP id a2so3016797ugf.48 for ; Thu, 03 Jan 2008 04:33:20 -0800 (PST) In-Reply-To: <20071222123027.GJ13112@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 What are you proposing? - Carsten 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 > > text/html; mailcap_bg %s url_handler.sh "@s" || logger > "url_handler.sh failed on %s"; test=test -n "$DISPLAY" && > mailcap_test %s firefox; nametemplate=%s.html > text/html; w3m -T text/html -dump %s || lynx -dump %s || links -dump > %s; copiousoutput; nametemplate=%s.html; description=HTML text > > The mailcap(4) man page doesn't explicitly say whether multiple %s is > allowed or not, but it has always worked for me. The > > w3m || lynx || links > > example above is a particularly common use case, AFAIK. > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode