all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: how to embed the current buffer name into the compile-comand
       [not found] <1186117201.185805.170150@i13g2000prf.googlegroups.com>
@ 2007-08-04  1:03 ` sunway
  2007-08-04  9:44   ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: sunway @ 2007-08-04  1:03 UTC (permalink / raw)
  To: help-gnu-emacs

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"))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to embed the current buffer name into the compile-comand
  2007-08-04  1:03 ` how to embed the current buffer name into the compile-comand sunway
@ 2007-08-04  9:44   ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2007-08-04  9:44 UTC (permalink / raw)
  To: help-gnu-emacs

> From: sunway <sunwayforever@gmail.com>
> Date: Fri, 03 Aug 2007 18:03:28 -0700
> 
> (setq compile-command (concat (concat "g++ -Wall " (buffer-file-name))
> " &&./a.out"))

There's no need for nested `concat' invocations: `concat' accepts any
number of arguments, not just 2.

See the doc string of `concat' for more details.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-04  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1186117201.185805.170150@i13g2000prf.googlegroups.com>
2007-08-04  1:03 ` how to embed the current buffer name into the compile-comand sunway
2007-08-04  9:44   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.