emacs-devel
[Top][All Lists]
Advanced

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

Should shell-quote-argument really use (eq system-type 'windows-nt)?


From: Stephan Stahl
Subject: Should shell-quote-argument really use (eq system-type 'windows-nt)?
Date: Mon, 7 Mar 2005 13:59:28 +0100 (CET)
User-agent: SquirrelMail/1.4.0

Hi.

I think shell-quote-argument should not use
(eq system-type'windows-nt)
instead it should take shell-file-name into account.

It seems very usual for emacs users on w32 to use cygwin or mingw.
Right now shell-quote-argument would return something wrong when bash
or some "intelligent" shell is used on w32 because it assumes a dumb
w32 shell.

What do others think about this (little tested) change?

diff -c "subr.el.~1.433~" "subr.el"
*** subr.el.~1.433~ Mon Mar  7 13:47:21 2005
--- subr.el Mon Mar  7 13:48:36 2005
***************
*** 2274,2280 ****
                                   "\\" (substring argument end (1+ end)))
                    start (1+ end))))
        (concat "\"" result (substring argument start) "\""))
!     (if (eq system-type 'windows-nt)
        (concat "\"" argument "\"")
        (if (equal argument "")
          "''"
--- 2274,2280 ----
                                   "\\" (substring argument end (1+ end)))
                    start (1+ end))))
        (concat "\"" result (substring argument start) "\""))
!     (if (string-match shell-dumb-shell-regexp shell-file-name)
        (concat "\"" argument "\"")
        (if (equal argument "")
          "''"

Stephan
-- 
Stephan Stahl




reply via email to

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