emacs(重新编译-y)

qon*_*onf 7 emacs elisp

是否可以将"-yes"标志传递给emacs中的"重新编译"命令?

请原谅我完全缺乏(e)lisp专有技术.我厌倦了去Emacs外面编译我的乳胶代码,所以我在我的.emacs中添加了以下键绑定:

(global-set-key (kbd "<f12>") 'recompile);
Run Code Online (Sandbox Code Playgroud)

是否可以自动对可能出现的以下提示回答"是":"编译过程正在运行;请将其删除?(是或否)."

此外,是否可以使打开的窗口显示输出以自动滚动到底部.有趣的东西通常在那里.也许可以在重新编译后链接以下命令:"Cx o,end-of-buffer".

谢谢!

Gar*_*ees 7

这里有一些代码可以解决您的第一个问题(中断当前编译):

(defun interrupt-and-recompile ()
  "Interrupt old compilation, if any, and recompile."
  (interactive)
  (ignore-errors (kill-compilation))
  (recompile))
Run Code Online (Sandbox Code Playgroud)

对于第二个问题(滚动编译输出),只需自定义用户设置compilation-scroll-output.