Package: mime-support
Version: 3.46-1
Severity: normal

I've observed that there's no way to differentiate between
calling run-mailcap to view an file (for example running ooffice)
and calling run-mailcap to translate a file to text/plain (for
example for viewing in mutt).  The only indicator available is
to unset the DISPLAY variable and masquerade the terminal, but
that's inherently flawed because some translators (unoconv for
example) need an X connection even when they're just converting
to text/plain.

I came to the conclusion that --action=cat should ignore mailcap
entries other than copiousoutput.

Consider the following example mailcap entries:

text/html; firefox   file://%s ; nametemplate=%s.html ; test=test -n "$DISPLAY" 
&& which firefox >/dev/null 2>&1
text/html; w3m       file://%s ; nametemplate=%s.html ; needsterminal ; 
test=which w3m >/dev/null 2>&1
text/html; w3m -dump file://%s ; nametemplate=%s.html ; copiousoutput ; 
test=which w3m >/dev/null 2>&1

In this case, what if one wants to dump the rendered output to
stdout?  No-can-do with run-mailcap except with silly
workarounds:
            
    $ env -u DISPLAY run-mailcap --action=cat /tmp/foo.html | cat

What we really want is for --action=cat to intentionally select
the copiousoutput entry.  I'll follow up with a patch to fix
this.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (650, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

mime-support depends on no packages.

Versions of packages mime-support recommends:
ii  file                          5.03-1     Determines file type using "magic"

mime-support suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to