info-gnus-english
[Top][All Lists]
Advanced

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

Re: External viewers; Select-by-Copy


From: Ted Zlatanov
Subject: Re: External viewers; Select-by-Copy
Date: Wed, 02 Dec 2009 14:06:39 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux)

On Wed, 02 Dec 2009 11:27:24 -0500 "Mark T. B. Carroll" <mtbc@ixod.org> wrote: 

MTBC> Ted Zlatanov <tzz@lifelogs.com> writes:

>> You can do the disassociation in a shell/Perl/etc. script. Also there
>> are programs to launch the URL or file in the OS's default URL
>> handler, e.g. in Ubuntu there's a way to do it. When you launch the
>> URL or file that way, the handler won't be associated with Emacs.

MTBC> Ah, thank you, I just need an intermediate handler of some kind that can
MTBC> do the disassociation. That might actually be worth to getting around
MTBC> to. Some applications can remember what state they were in when they
MTBC> were killed and then restore it, but things like Adobe Reader don't.

On Ubuntu you can install the `daemon' command (look at the man page to
see how complicated the process is, and you probably want it with the
-foreground option).  There's a `detach' program to do a similar task as
well on other Unix systems.

Remember to copy the file in your script.  The original temporary file
will be deleted when your script launches the child and exits.  Here's
a 100% untested version:

#!/usr/bin/perl

use strict;
use warnings;
use File::Copy;

my $tf = "/tmp/temporary-$$";
copy($ARGV[0],$tf) or die "Copy of $ARGV[0] to $tf failed: $!";

# note the => is effectively a comma that quotes the left side
exec (daemon => -f => "your command here" => "argument1" => "argument2" => $tf);

Ted


reply via email to

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