unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* NEWBIE: different compile-commands for different fiel types (cc, xml)
@ 2004-10-28 14:04 Johannes Kastl
  2004-10-28 16:54 ` Kevin Rodgers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johannes Kastl @ 2004-10-28 14:04 UTC (permalink / raw)


Hello everyone,
Im kind of a newbie to emacs, or more to configuration emacs. I have 
been using emacs for quite some time, and now I need to setup the 
compile-command.
The background is that I am compiling .cc files, and also .xml files 
at the moment. And I am proud that I got it working to specify my 
own complie-command in the settings. But it is only one, for the 
other filetype I have to change it everytime, which is "kind of 
uncomfortable". So, is there a way to set the compile-command to 
"make whatever" for .cc files and to "make anotherthing" for .xml files?
Adding local variables in xml files dont work for me, since it 
doesnt compile afterwards, cos the source code contains "non-xml" text.

Has anybody got an idea how to solve this, or is this just not 
possible with my emacs?

Thanks in advance,

Johannes

P.S. I am running emacs on a suse 8.2 linux, emacs is GNU Emacs 
21.2.1 (i586-suse-linux).

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

* Re: NEWBIE: different compile-commands for different fiel types (cc,  xml)
  2004-10-28 14:04 NEWBIE: different compile-commands for different fiel types (cc, xml) Johannes Kastl
@ 2004-10-28 16:54 ` Kevin Rodgers
  2004-10-31 21:58 ` Kai Grossjohann
       [not found] ` <mailman.6438.1099256981.2017.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2004-10-28 16:54 UTC (permalink / raw)


Johannes Kastl wrote:
 > The background is that I am compiling .cc files, and also .xml files at
 > the moment. And I am proud that I got it working to specify my own
 > complie-command in the settings. But it is only one, for the other
 > filetype I have to change it everytime, which is "kind of
 > uncomfortable". So, is there a way to set the compile-command to "make
 > whatever" for .cc files and to "make anotherthing" for .xml files?
 > Adding local variables in xml files dont work for me, since it doesnt
 > compile afterwards, cos the source code contains "non-xml" text.

,----[ C-h v compile-command RET ]
| compile-command's value is "make -k "
|
| Documentation:
| *Last shell command used to do a compilation; default for next 
compilation.
|
| Sometimes it is useful for files to supply local values for this variable.
| You might also use mode hooks to specify it in certain modes, like this:
|
|     (add-hook 'c-mode-hook
|        (lambda ()
| 	 (unless (or (file-exists-p "makefile")
| 		     (file-exists-p "Makefile"))
| 	   (set (make-local-variable 'compile-command)
| 		(concat "make -k "
| 		        (file-name-sans-extension buffer-file-name))))))
|
| You can customize this variable.
|
| Defined in `compile'.
`----

(add-hook 'cc-mode-hook                 ; or c-mode-hook, or ?
           (lambda ()
             (set (make-local-variable 'compile-command) "make whatever")))

(add-hook 'xml-mode-hook                ; or sgml-mode-hook, or ?
           (lambda ()
             (set (make-local-variable 'compile-command) "make 
anotherthing")))

-- 
Kevin Rodgers

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

* Re: NEWBIE: different compile-commands for different fiel types (cc, xml)
  2004-10-28 14:04 NEWBIE: different compile-commands for different fiel types (cc, xml) Johannes Kastl
  2004-10-28 16:54 ` Kevin Rodgers
@ 2004-10-31 21:58 ` Kai Grossjohann
       [not found] ` <mailman.6438.1099256981.2017.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Grossjohann @ 2004-10-31 21:58 UTC (permalink / raw)


Johannes Kastl <ojkastl@gmx.de> writes:

> Adding local variables in xml files dont work for me, since it 
> doesnt compile afterwards, cos the source code contains "non-xml" text.

Hm?

<!-- Local Variables: -->
<!-- compile-command: "make bla" -->
<!-- End: -->

No non-XML text to be seen here.

Kai

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

* Re: NEWBIE: different compile-commands for different fiel types (cc,  xml)
       [not found] ` <mailman.6438.1099256981.2017.help-gnu-emacs@gnu.org>
@ 2004-11-07 17:10   ` Johannes Kastl
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Kastl @ 2004-11-07 17:10 UTC (permalink / raw)


Hello,

thanks for your answers. Especially the comments for xml are really 
great. So this problem is solved due to your help.

Thanks very much.

OJ



-- 
Als Frau Gamasche sie mit zitternder Stimme gefragt hatte, wie man den
Vetter zweiten Grades einer Königin ansprach, antwortete Susanne
gedankenlos: "Wir nannten ihn einfach Jamie".
(Terry Pratchett, Schweinsgalopp, S.72)

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

end of thread, other threads:[~2004-11-07 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-28 14:04 NEWBIE: different compile-commands for different fiel types (cc, xml) Johannes Kastl
2004-10-28 16:54 ` Kevin Rodgers
2004-10-31 21:58 ` Kai Grossjohann
     [not found] ` <mailman.6438.1099256981.2017.help-gnu-emacs@gnu.org>
2004-11-07 17:10   ` Johannes Kastl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).