1

任何人都可以建议修改 mode-compile.el 以使其在 Windows 上更好地工作吗?我的具体问题是处理包含空格的路径名。我正在使用 Ruby 中的代码,使用“GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600) of 2008-03-26 on RELEASE”,mode-compile.el 版本:2.29(最后修改:2006/12 /01 13:52:47)

mode-compile.el 生成的用于编译(运行)我的缓冲区 a.rb 的命令行是这样的:

c:/ruby/bin\ruby.exe -wc:/Documents and Settings/William/My Documents/src/a.rb

这会产生此错误:

c:/ruby/bin\ruby.exe: 没有这样的文件或目录 -- c:/Documents (LoadError)

这工作得很好:

c:/ruby/bin\ruby.exe -w "c:/Documents and Settings/William/My Documents/src/a.rb"

作为一种解决方法,我可以移动我的目录树,以便路径没有嵌入的空白。查看 mode-compile.el 中的代码,似乎已经存在一个添加引号的函数,但是,由于我不精通 emacs-lisp,也许这实际上做了一些完全不同的事情(比如只是附加一个几乎空的双引号的par):

(if to-compile-fname (if mc--build-op-args (mc--build-output-args to-compile-fname) (concat " " to-compile-fname) ) " "))))

mode-compile.el 来自这里: http: //perso.tls.cena.fr/boubaker/distrib/mode-compile.el

提前致谢!

威廉

4

1 回答 1

0

我真的没有时间对此进行测试,但在我看来,该功能mc--shell-compile需要更新。缓冲区的文件名由以下行提取:

     (shfile  (or mc--remote-pathname (buffer-file-name)
                  (error "Compilation abort: Buffer %s has no filename"
                         (buffer-name))))

修复应该是引用buffer-file-name

     (shfile  (or mc--remote-pathname (shell-quote-argument buffer-file-name)
                  (error "Compilation abort: Buffer %s has no filename"
                         (buffer-name))))

请问可以试一试吗?

干杯,丹尼尔

于 2009-06-04T07:06:21.033 回答