【发布时间】:2013-07-11 14:37:56
【问题描述】:
(shell-command "\"C:\\Documents and Settings\\ggustafson\\Desktop\\stuff\\ctags58\\ctags.exe\" -eR -f \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\\TAGS\" \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\"")
(message "\"C:\\Documents and Settings\\ggustafson\\Desktop\\stuff\\ctags58\\ctags.exe\" -eR -f \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\\TAGS\" \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\"")
执行最上面的表单给了我错误'C:\Documents' is not recognized as an internal or external command, operable program or batch file.。执行输出,第二种形式放入*Messages* 缓冲区按预期工作(创建一个标签文件)。
为什么我使用这两种技术没有得到相同的结果? shell-command 在将字符串发送到 shell 之前是否会更改字符串?如何使用 elisp 来执行一个字符串,就像我将它粘贴到命令提示符中一样?
shell-quote-argument 也不起作用,因为它会生成一个无法用任何一种方法执行的字符串:
(message (shell-quote-argument "\"C:\\Documents and Settings\\ggustafson\\Desktop\\stuff\\ctags58\\ctags.exe\" -eR -f \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\\TAGS\" \"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\""))
"^\"\\^\"C:\\Documents and Settings\\ggustafson\\Desktop\\stuff\\ctags58\\ctags.exe\\^\" -eR -f \\^\"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\\TAGS\\^\" \\^\"C:\\Documents and Settings\\ggustafson\\Desktop\\BlueTooth_7020\\^\"^\""
【问题讨论】:
-
您可能使用了不同版本的
ctags.exe。您可以尝试使用完整路径吗? -
查找
C-h f shell-quote-argument -
@slitvinov 我一直在使用完整路径,所以 AFAIK 这是 emacs 而不是 ctags 的问题。编辑问题以澄清这一点。
-
@phils 我有,看到问题,但我看不到它如何解决我的问题。