emacs - Can't execute a string as a shell command in elisp -


(shell-command "\"c:\\documents , settings\\ggustafson\\desktop\\stuff\\ctags58\\ctags.exe\" -er -f \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\\tags\" \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\"")  (message "\"c:\\documents , settings\\ggustafson\\desktop\\stuff\\ctags58\\ctags.exe\" -er -f \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\\tags\" \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\"") 

executing top form gives me error 'c:\documents' not recognized internal or external command, operable program or batch file.. executing output second form puts *messages* buffer works intended (creates tags file).

why not getting same results both techniques? shell-command changes string before sending shell? how can use elisp execute string if had pasted command prompt?

shell-quote-argument not work either produces string cannot executed either method:

(message (shell-quote-argument "\"c:\\documents , settings\\ggustafson\\desktop\\stuff\\ctags58\\ctags.exe\" -er -f \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\\tags\" \"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\"")) "^\"\\^\"c:\\documents , settings\\ggustafson\\desktop\\stuff\\ctags58\\ctags.exe\\^\" -er -f \\^\"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\\tags\\^\" \\^\"c:\\documents , settings\\ggustafson\\desktop\\bluetooth_7020\\^\"^\"" 

shell-quote-argument quoting single argument shell command (hence name), not shell command in entirety.

given error seeing suggested lack of quoting somewhere, seemed idea use built-in command deal quoting rather writing manually , assuming had correct syntax.

another alternative using m-! execute command (or similar one) interactively, figure out gets accepted, , afterwards use c-xm-: obtain elisp form.


Comments