all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* BUG: org-open-file fails with multiple %s in mailcap entry
@ 2007-12-22 12:30 Adam Spiers
  2008-01-03 12:33 ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Spiers @ 2007-12-22 12:30 UTC (permalink / raw)
  To: org-mode mailing list

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-03 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-22 12:30 BUG: org-open-file fails with multiple %s in mailcap entry Adam Spiers
2008-01-03 12:33 ` Carsten Dominik
2008-01-03 12:41   ` Adam Spiers
2008-01-03 12:51     ` Carsten Dominik

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.