views:

63

answers:

2

I often have shell scripts that call other scripting languages, like so:


#!/bin/bash
cat somefile|awk '
BEGIN
{
  #This line is not auto-indented and is colored as a string constant.
  ...
}
{
  #Same with this line.
  ...
}'

echo "More Bash code here."
...

Is there a way to make Emacs recognize the awk string as an awk program instead of just a string constant?

+1  A: 

You will need to make your own extensions to your existing emacs lisp files. Here is a helpful tutorial on learning emacs lisp:
http://www.gnu.org/software/emacs/emacs-lisp-intro/

And here is an example of an .el file that colors html:
http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el

Once you're done, post it online so others can benefit!

Jason R. Mick
+1  A: 

I use mmm-mode for Mason files (mixing HTML and Perl); maybe it can be of use in your case as well?

asjo