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

Re: MIME support



Christian Hudon:
 > > It would also be (very) nice if install-info produced a mailcap
 > > file that works under both X and the console. Packages could then
 > > register themselves as supporting type image/gif (say) under X or
 > > the console or both.

Brian C. White:
 > That would be much more difficult.  I don't see how, as a plain
 > file, "mailcap" could differentiate.

I imagine it would be along the lines of the way mailcap distinguishes
between different files encoded in the same format -- it would leave
that up to the program it calls.  Say, perhaps, you some script named
X-or-console which takes two strings as an argument -- the first would
be the command to execute under X, the second on the console.  It
might look something like this:

#!/bin/sh
# execute $1 if running under X, $2 otherwise
# note: X routines needn't run in foreground
if [ -z $DISPLAY ]; then
	eval $1 &
else
	eval exec $2
fi


Of course, there may be a better way to deal with this.  [This
requires that the install program recognize the X-or-console program
and treat it specially.  It may also require some special handling of
quotes.]

-- 
Raul



Reply to: