shell-script-mode based on contents?

shell-script-mode based on contents?

Post by mike » Mon, 26 Jan 2009 08:49:47



Through a couple of means I can get shell-script-mode on many kinds of
files (plain text cfg files, etc.) but I also notice that if the first
line of a file is "#!/bin/csh" it too will start with that mode enabled;
so is there a way to have emacs load shell-script-mode for a file with a
non-determinate filename (where I can't add "#;-*-Shell-script-*-") that's
first line is something like "#!/bin/runscript"?


--
 
 
 

shell-script-mode based on contents?

Post by bojohan+ne » Mon, 26 Jan 2009 09:43:31

mike < XXXX@XXXXX.COM > writes:


interpreter-mode-alist

 
 
 

shell-script-mode based on contents?

Post by mike » Mon, 26 Jan 2009 12:56:17


fantastic! thank you

--
 
 
 

shell-script-mode based on contents?

Post by Mark Woodi » Tue, 27 Jan 2009 02:24:07

mike < XXXX@XXXXX.COM > writes:


: 57.3.4.1 Specifying File Variables
: ..................................

[...]

: In shell scripts, the first line is used to identify the script
: interpreter, so you cannot put any local variables there. To
: accommodate this, Emacs looks for local variable specifications in the
: _second_ line when the first line specifies an interpreter.

-- [mdw]