在Emacs编译程序? [英] Compiling Programs from Within Emacs?

查看:171
本文介绍了在Emacs编译程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是编译在Emacs程序的最佳方式?目前我正在打开一个单独的缓冲区 CX 3 并使用里面ESHELL运行的Mx ESHELL 然后调用要么使或铛直;大部分我做的时候都一个Makefile成立。

What is the best way to compile programs inside emacs? I am currently opening a separate buffer with C-x 3 and running eshell inside it using M-x eshell then invoking either make or clang directly; most of the time I do have a Makefile set up.

有没有使用运行编译过程中任何优势 M-X编译 VS运行make里面ESHELL?任何其他的方式来做到这一点,有什么优势/那些缺点是什么?

Is there any advantage with running the compilation process using M-x compile vs running make inside eshell? Any other ways to do it and what are the advantages/disadvantages of those?

推荐答案

要做到这一点,最简单的方法是使用内置的 Emacs的编译命令。 M-X编译应该做你的罚款。然后,您可以编辑将要运行的命令(默认使-k ),然后回车来运行编译。 Emacs就会解析输出,如果发现任何错误,他们将链接到源文件,这样你就可以在缓冲区中打开它们。

The easiest way to do this is to use the Emacs built-in compile command. M-x compile should do you fine. You can then edit the command that will be run (by default make -k) and then hit return to run the compilation. Emacs will then parse the output and if it finds any errors they will link to the source files so you can open them in a buffer.

这件事积极因素是:


  • 输出缓冲器的解析

  • 调用之间编译命令背诵

  • 编译输出在非选择的缓冲液中,可以快速编辑您正在处理的文件,并修复任何愚蠢的错误。

  • M-N M-P 通过滚动的错误信息

  • Parsing of the output buffer
  • Memorisation of the compile command between invocations
  • Compilation output is shown in a non-selected buffer, you can quickly edit the file you were working on and fix any silly errors.
  • M-n and M-p scroll by error messages

大多数这些功能是由提供编译小调模式轻微的模式虽然不是实际的编译命令和缓冲区。一旦你已经在 ESHELL 运行编译命令你很可能被未成年人模式设置为编译小调模式

Most of these features are provided by the compilation-minor-mode minor mode though not the actual compilation command and buffer. Once you have run a compilation command in eshell you could probably get similar results by setting the minor mode to compilation-minor-mode.

这篇关于在Emacs编译程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆