Emacs默认使用该命令 make -k
我跑的时候 compile
。不过,我差不多 决不 认为有用是有用的 make
错误后继续,所以我 总是 去除 -k
旗。有没有办法改变我的默认值 .emacs
所以它就是这样 make
?
Emacs默认使用该命令 make -k
我跑的时候 compile
。不过,我差不多 决不 认为有用是有用的 make
错误后继续,所以我 总是 去除 -k
旗。有没有办法改变我的默认值 .emacs
所以它就是这样 make
?
(setq compile-command“make”)
或.emacs中的类似内容就足够了。
有关详细信息,请键入
C-h f compile
它描述了调用M-x编译时使用的变量。
在那里,你应该看到它调用compile-command和a
C-h v compile-command
告诉你这个默认为“make -k”。以上都是简化,但如果您需要进一步挖掘,所有信息都应该在这些命令中。
由于我需要针对不同模式的不同编译器,我使用以下代码段(此处显示为javascript):
(require 'compile)
(add-hook 'js-mode-hook
(lambda ()
(set (make-local-variable 'compile-command)
(format "jshint %s" (file-name-nondirectory buffer-file-name)))))
这运行“jshint”作为我的编译命令。然后我可以为其他语言添加钩子,并根据我的需要自定义每个语言。