emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Adam Spiers
Subject: [Orgmode] BUG: org-open-file fails with multiple %s in mailcap entry
Date: Sat, 22 Dec 2007 12:30:27 +0000
User-agent: Mutt/1.5.14 (2007-02-12)

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.




reply via email to

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