如何从Emacs编译缓冲区中获得快速状态?

时间:2020-03-06 14:33:16  来源:igfitidea点击:

默认情况下,emacs 22.1.1仅在我们首次发出compile命令时显示编译缓冲区的顶部。当我使用compile命令以保存击键时,我希望它自动滚动到底部。这样,我只需查看编译缓冲区并查看当前正在编译哪些文件,而不必切换窗口并滚动到缓冲区底部即可轻松获得当前编译的状态。有任何想法吗?

解决方案

从信息> emacs>编译:

If you set the variable compilation-scroll-output to a non-nil
  value, then the compilation buffer always scrolls to follow output as
  it comes in.

(setq compilation-scroll-output t)

或者

M-x set-variable compilation-scroll-output t RET

另外,如果在编译完成之前习惯使用next-errorprevious-error,我们将开始明白为什么需要默认行为。

我认为最好的选择是停止出现第一个错误

(setq compilation-scroll-output 'first-error)

使用此配置,Emacs滚动编译模式,直到出现第一个错误。这样,我们就可以在编译完成之前使用"下一个错误"和"上一个错误"。

如果没有任何错误,它将滚动到最后,因此我们可以轻松地看到编译成功。