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

shell-quote-argument v. single-quotes in mailcap



Hi,

I run WL on Ubuntu. When I receive .docx attachments with spaces in
them, I am unable to view them, for reasons explained below.

When WL tries to view a file:

  Wrote /tmp/EMI4754FdU/filename (2).docx
  External method is starting...
  soffice -no-oosplash -writer '/tmp/EMI4754FdU/filename\ \(2\).docx' finished

OpenOffice does not find the file because of double-quoting of the
file name.

Here is a line from my /etc/mailcap:

  application/vnd.openxmlformats-officedocument.wordprocessingml.document; soffice -no-oosplash -writer '%s'; edit=soffice -no-oosplash -writer '%s'; test=test -n "$DISPLAY"; description="Office Open XML Document"; nametemplate=%s.docx

Notices the quoted file arguments ('%s'). If I change a line in the
defun of mime-format-mailcap-command:

  (shell-quote-argument file))

to:

  file)

it prevents the double quoting.

  Wrote /tmp/EMI4754Sna/filename (2).docx
  External method is starting...
  soffice -no-oosplash -writer '/tmp/EMI4754Sna/filename (2).docx' finished

However, how to handle shell meta-characters in mailcap seems to be an
area of contention. I notice the run-mailcap command that comes with
debian makes a symlink for any file name with meta-characters.

Does anybody have any ideas about the right thing to do here? Do
people on other systems not have this problem?

best, Erik