Jason Rumney wrote:
We already have w32-system-shells, which is the inverse of the
variable you propose (except it is missing "cmdproxy.exe", I am not
sure if there is a good reason for that).
In fact we have a function w32-shell-dos-semantics for precisely this
purpose. So a suitable patch might be as below. The only thing left is
to silence the compiler warning about w32-shell-dos-semantics not being
defined on other platforms. Is (defun w32-shell-dos-semantics) the right
way to do that?
*** subr.el 04 Aug 2006 21:48:36 +0100 1.523
--- subr.el 28 Aug 2006 15:33:36 +0100
***************
*** 2039,2045 ****
(defun shell-quote-argument (argument)
"Quote an argument for passing as argument to an inferior shell."
! (if (eq system-type 'ms-dos)
;; Quote using double quotes, but escape any existing quotes in
;; the argument with backslashes.
(let ((result "")
--- 2039,2046 ----
(defun shell-quote-argument (argument)
"Quote an argument for passing as argument to an inferior shell."
! (if (or (eq system-type 'ms-dos)
! (and (eq system-type 'windows-nt) (w32-shell-dos-semantics)))
;; Quote using double quotes, but escape any existing quotes in
;; the argument with backslashes.
(let ((result "")
***************
*** 2053,2071 ****
"\\" (substring argument end (1+ end)))
start (1+ end))))
(concat "\"" result (substring argument start) "\""))
! (if (eq system-type 'windows-nt)
! (concat "\"" argument "\"")
! (if (equal argument "")
! "''"
! ;; Quote everything except POSIX filename characters.
! ;; This should be safe enough even for really weird shells.
! (let ((result "") (start 0) end)
! (while (string-match "[^-0-9a-zA-Z_./]" argument start)
! (setq end (match-beginning 0)
! result (concat result (substring argument start end)
! "\\" (substring argument end (1+ end)))
! start (1+ end)))
! (concat result (substring argument start)))))))
(defun string-or-null-p (object)
"Return t if OBJECT is a string or nil.
--- 2054,2070 ----
"\\" (substring argument end (1+ end)))
start (1+ end))))
(concat "\"" result (substring argument start) "\""))
! (if (equal argument "")
! "''"
! ;; Quote everything except POSIX filename characters.
! ;; This should be safe enough even for really weird shells.
! (let ((result "") (start 0) end)
! (while (string-match "[^-0-9a-zA-Z_./]" argument start)
! (setq end (match-beginning 0)
! result (concat result (substring argument start end)
! "\\" (substring argument end (1+ end)))
! start (1+ end)))
! (concat result (substring argument start))))))
(defun string-or-null-p (object)
"Return t if OBJECT is a string or nil.
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug