all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* shell-quote-argument bug on w32
@ 2006-09-25 13:41 Lennart Borgman
  2006-09-25 13:59 ` Jason Rumney
  2006-09-25 19:26 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Lennart Borgman @ 2006-09-25 13:41 UTC (permalink / raw)


shell-quote-argument actually is an "os quote argument". It does not 
check what shell is actually used. This is a bug in my opinion, but you 
notice it mostly on w32 where different shells are actually used.

I think therefore that shell-quote-argument should check shell-file-name 
at least when system-type is 'windows-nt. My suggestion for fixing this 
is introducing a variable like below and do the needed changes to 
`shell-quote-argument':

(defcustom shell-quote-types
  '( ("cmdproxy" w32cmd) )
  "Type of quoting to use for inferior shell.
A list of cons cells where the car of each cell is a regexp that
is matched against `shell-file-name' by
`shell-quote-argument'. When a match is found the corresponding
quoting type given by the cdr of the cons cell is used."
  :type '(repeat (list regexp symbol))
  :group 'shell)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 13:41 shell-quote-argument bug on w32 Lennart Borgman
@ 2006-09-25 13:59 ` Jason Rumney
  2006-09-25 19:36   ` Lennart Borgman
  2006-09-25 19:26 ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Jason Rumney @ 2006-09-25 13:59 UTC (permalink / raw)
  Cc: Emacs Devel

Lennart Borgman wrote:
> It does not check what shell is actually used.

It does, so can you give us the details of a specific case where this fails?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 13:41 shell-quote-argument bug on w32 Lennart Borgman
  2006-09-25 13:59 ` Jason Rumney
@ 2006-09-25 19:26 ` Eli Zaretskii
  2006-09-25 19:51   ` Lennart Borgman
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2006-09-25 19:26 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Mon, 25 Sep 2006 15:41:16 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> shell-quote-argument actually is an "os quote argument". It does not 
> check what shell is actually used. This is a bug in my opinion, but you 
> notice it mostly on w32 where different shells are actually used.

I don't think it's a bug on Posix platforms, since /bin/sh is
generally invoked there, even if the interactive shell is different.

> I think therefore that shell-quote-argument should check
> shell-file-name at least when system-type is 'windows-nt.

I think it's needed _only_ on windows-nt.  Cygwin uses Bash, while the
DOS port doesn't need to distinguish between the different shells,
since the functions it uses for subprogram invocation DTRT in all
cases.

> (defcustom shell-quote-types
>   '( ("cmdproxy" w32cmd) )
>   "Type of quoting to use for inferior shell.
> A list of cons cells where the car of each cell is a regexp that
> is matched against `shell-file-name' by
> `shell-quote-argument'. When a match is found the corresponding
> quoting type given by the cdr of the cons cell is used."
>   :type '(repeat (list regexp symbol))
>   :group 'shell)

This isn't needed, since we already have w32-system-shell-p and
w32-shell-dos-semantics, see w32-fns.el.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 13:59 ` Jason Rumney
@ 2006-09-25 19:36   ` Lennart Borgman
  2006-09-25 21:40     ` Jason Rumney
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2006-09-25 19:36 UTC (permalink / raw)
  Cc: Emacs Devel

Jason Rumney wrote:
> Lennart Borgman wrote:
>> It does not check what shell is actually used.
>
> It does, so can you give us the details of a specific case where this 
> fails?

I can not see that shell-file-name is used in shell-quote-argument. What 
do you mean?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 19:26 ` Eli Zaretskii
@ 2006-09-25 19:51   ` Lennart Borgman
  2006-09-26  3:13     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2006-09-25 19:51 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Mon, 25 Sep 2006 15:41:16 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>
>> shell-quote-argument actually is an "os quote argument". It does not 
>> check what shell is actually used. This is a bug in my opinion, but you 
>> notice it mostly on w32 where different shells are actually used.
>>     
>
>   
>> I think therefore that shell-quote-argument should check
>> shell-file-name at least when system-type is 'windows-nt.
>>     
>
> I think it's needed _only_ on windows-nt.  Cygwin uses Bash, while the
>
>   
>> (defcustom shell-quote-types
>>   '( ("cmdproxy" w32cmd) )
>> ...
> This isn't needed, since we already have w32-system-shell-p and
> w32-shell-dos-semantics, see w32-fns.el.
>   
Ah, thanks, I forgot about that. I just still feel that 
shell-quote-argument is to hard to use. Maybe it should have an optional 
second argument? That could perhaps make it much easier to use on w32.

The reason I was thinking about it was actually the problems I reported 
yesterday in "Ftp and file name with spaces". It looks to me that 
probably should quoting there be unix style. And it does not matter what 
the shell is since the ftp program is run directly (or am I missing 
something there?).

So what is needed on w32 seems to be a way to tell for each program how 
quoting should be done. And a second optional argument to 
shell-quote-argument would probably make the coding quite a bit easier.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 19:36   ` Lennart Borgman
@ 2006-09-25 21:40     ` Jason Rumney
  2006-09-25 23:05       ` Jason Rumney
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Rumney @ 2006-09-25 21:40 UTC (permalink / raw)
  Cc: Emacs Devel

Lennart Borgman wrote:
> I can not see that shell-file-name is used in shell-quote-argument. 
> What do you mean?
>
Are you looking at a different version than the latest one?

  (if (or (eq system-type 'ms-dos)
          (and (eq system-type 'windows-nt) (w32-shell-dos-semantics)))


w32-shell-dos-semantics is a compiled Lisp function in `w32-fns.el'.
(w32-shell-dos-semantics)

Return non-nil if the interactive shell being used expects MSDOS shell 
semantics.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 21:40     ` Jason Rumney
@ 2006-09-25 23:05       ` Jason Rumney
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Rumney @ 2006-09-25 23:05 UTC (permalink / raw)
  Cc: Lennart Borgman, Emacs Devel

Jason Rumney wrote:
>  (if (or (eq system-type 'ms-dos)
>          (and (eq system-type 'windows-nt) (w32-shell-dos-semantics)))

I've now checked in this change, which I'd made locally in response to 
an earlier report then neglected to check-in.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-25 19:51   ` Lennart Borgman
@ 2006-09-26  3:13     ` Stefan Monnier
  2006-09-26 11:11       ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2006-09-26  3:13 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

> The reason I was thinking about it was actually the problems I reported
> yesterday in "Ftp and file name with spaces". It looks to me that probably
> should quoting there be unix style. And it does not matter what the shell is
> since the ftp program is run directly (or am I missing something there?).

I think the quoting to be used is at best unclear, and most likely,
depending on the ftp server, no amount of quoting will fix it.
I.e. I think the only reliable solution is to first copy the file to some
other file (with a name without spaces) and then send that.


        Stefan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: shell-quote-argument bug on w32
  2006-09-26  3:13     ` Stefan Monnier
@ 2006-09-26 11:11       ` Lennart Borgman
  0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2006-09-26 11:11 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Stefan Monnier wrote:
>> The reason I was thinking about it was actually the problems I reported
>> yesterday in "Ftp and file name with spaces". It looks to me that probably
>> should quoting there be unix style. And it does not matter what the shell is
>> since the ftp program is run directly (or am I missing something there?).
>>     
>
> I think the quoting to be used is at best unclear, and most likely,
> depending on the ftp server, no amount of quoting will fix it.
> I.e. I think the only reliable solution is to first copy the file to some
> other file (with a name without spaces) and then send that.
>   
But for the local file names I guess quoting could be used? (But it 
might still be unclear?)

On w32 a solution might be to send  short path names to the ftp program 
if there are spaces in the local file name. I do not know about other 
platforms though. Quoting the local file name before sending it to the 
ftp program seems to be more platform independent.

I would be glad if we could solve this bug on the local side.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-09-26 11:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-25 13:41 shell-quote-argument bug on w32 Lennart Borgman
2006-09-25 13:59 ` Jason Rumney
2006-09-25 19:36   ` Lennart Borgman
2006-09-25 21:40     ` Jason Rumney
2006-09-25 23:05       ` Jason Rumney
2006-09-25 19:26 ` Eli Zaretskii
2006-09-25 19:51   ` Lennart Borgman
2006-09-26  3:13     ` Stefan Monnier
2006-09-26 11:11       ` Lennart Borgman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.