emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] BUG: org-open-file fails with multiple %s in mailcap entry


From: Carsten Dominik
Subject: Re: [Orgmode] BUG: org-open-file fails with multiple %s in mailcap entry
Date: Thu, 3 Jan 2008 13:33:16 +0100

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.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode





reply via email to

[Prev in Thread] Current Thread [Next in Thread]