[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to embed the current buffer name into the compile-comand
From: |
sunway |
Subject: |
Re: how to embed the current buffer name into the compile-comand |
Date: |
Fri, 03 Aug 2007 18:03:28 -0700 |
User-agent: |
G2/1.0 |
On 8 3 , 1 00 , moonrie <moon...@gmail.com> wrote:
> i have got my compile-command like *g++ -Wall a.cpp && ./a.out",
> however, if i am coding b.cpp, i gotta change it from a.cpp to b.cpp.
>
> so, can emacs do this itself, when i invoke the compile command?
>
> thank you in advance.
try:
(setq compile-command (concat (concat "g++ -Wall " (buffer-file-name))
" &&./a.out"))