emacs的compile-command的写法?

Vim、Emacs配置和使用
回复
头像
dustin.xu
帖子: 75
注册时间: 2007-10-14 11:51

emacs的compile-command的写法?

#1

帖子 dustin.xu » 2008-02-01 23:17

emacs中的默认编译命令,设置起来这样(我写c++):(setq compile-command "g++ 文件名")
那么有没有办法让系统自动知道哪个文件名?这样我直接按个键,譬如F7,就可以自动完成编译了,而现在每次我都得按F7以后,再写文件名。还有,如何运行?在emacs里面开一个shell吗?

不知道有没有说清楚问题,谢谢
forcotton
帖子: 57
注册时间: 2006-10-06 21:10

#2

帖子 forcotton » 2008-02-02 10:05

M-x compile 会提示你修改编译命令,然后执行。上次用过的编译命令还在,如果不需要改变直接按回车就好了。
另外有一个recompile命令。希望这个对你来说足够好了。

贴一个我的关于编译的配置。

代码: 全选

(global-set-key [f9] 'humble-recompile)
(global-set-key [(ctrl f9)] 'compile)

(defun humble-recompile () 
  "recompile if possible"
  (interactive) 
  (if (fboundp 'recompile)
      (recompile)
    (call-interactively 'compile)))
wenjianhn
帖子: 583
注册时间: 2008-10-15 10:49
来自: CS

Re: emacs的compile-command的写法?

#3

帖子 wenjianhn » 2009-07-29 11:00

smart-compile.el

代码: 全选

 _____________
< 呜呜buntu >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
回复