emacs-devel
[Top][All Lists]
Advanced

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

Re: hexl and running a shell


From: Stefan Monnier
Subject: Re: hexl and running a shell
Date: Fri, 30 Nov 2001 06:23:27 -0500

> > From: "Stefan Monnier" <monnier+gnu/address@hidden>
> > Date: Fri, 30 Nov 2001 05:00:57 -0500
> > 
> > For some reason, `hexl' currently uses shell-command-on-region
> > even though it doesn't use any particular feature of the shell.
> > I use the patch below which makes it use call-process-region
> > instead.
> 
> I think this might be dangerous: call-process-region requires that you
> figure out in advance how to group together command-line arguments
> that have embedded whitespace.  split-string won't cut it.

Well the `split-string' are only there for backward compatibility
(and all the options of hexl are properly handled by `split-string').
I tend to think that the advantage of call-process-region is that
you do not need to worry about funny characters in file names and such.

> As another example, what if hexl-options includes redirection of
> stderr?

Could it ever ?

> > It was arguably a misconfiguration on his part, but OTOH there's
> > really no good reason why hexl-mode should use the shell.
> 
> I think user-level features that invoke subsidiary programs should in
> general behave as if the command was typed at the shell prompt.  That
> means you need to go through the shell, even if in most cases a
> simple call-process or call-process-region will do.

But that suffers from the problem of having to properly quote the arguments
(BTW: shell-quote-argument does not properly quote \n) and requires the
presence of a properly configured shell.

More to the point here: `hexl' is really not a separate program
but seems intimately linked to hexl-mode, so I'm wondering how
much customization is even possible for hexl-options and
hexlify-command and dehexlify-command.


        Stefan




reply via email to

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