emacs-devel
[Top][All Lists]
Advanced

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

Re: shell-quote-argument: make it behave as if on Unix?


From: Kai Großjohann
Subject: Re: shell-quote-argument: make it behave as if on Unix?
Date: Tue, 16 Apr 2002 11:25:49 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i686-pc-linux-gnu)

Richard Stallman <address@hidden> writes:

>     The Tramp package sends commands to a remote Unix host.  These
>     commands sometimes include filenames, so I pass those through
>     shell-quote-argument.
>
> I think you should copy the code you want into your own source file
> and give it a different function name.

I've been thinking about this for a long time now, and I would like
to thank Richard for his very useful advice.  All things considered,
I think he is right.

OT1H it would be nice to reuse code.

But OTOH, there are a number of issues with shell-quote-argument as
it currently stands, and Tramp can only use it after these have been
decided.

(1) [This issue has been discussed in the current thread.]
    shell-quote-argument always quotes for the system that Emacs is
    running on, but some applications (such as Tramp) might wish to
    use the strings on a different system.

(2) shell-quote-argument does not deal well with newlines in strings.
    For instance, it converts "a\nb" into "a\\\nb" which the (Bourne)
    shell then reads as "ab".  There is no method (that I know of)
    which works for both Bourne-ish and c-ish shells on Unix.

So I will (maybe not today) change tramp-shell-quote-argument in such
a way that it does the work itself.  After that, it is not urgent to
change the behavior of shell-quote-argument.

Are people interested in me working on changing shell-quote-argument
to deal with the above two issues?  I'll look through the Lisp code
in Emacs to see that the change is upwardly¹ compatible.

kai

¹ Or is it "upwards-compatible"?
-- 
Silence is foo!



reply via email to

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