From: Alex L. <al...@us...> - 2000-11-28 06:01:57
|
Folks, I've just started using MMM - great package - great idea! I have shell-scripts that have embedded `awk' in them. I've successfully created an `embedded-awk' mode, from .emacs: (require 'mmm-mode) (mmm-add-find-file-hook) ;;{{{ awk embedded in shell (mmm-add-classes '((embedded-awk :submode awk-mode :front "awk --source='" :back "'"))) ;;}}} MMM correctly identifies and font-locks the regions in the shell script, for example, in the script below, `awk' mode is in effect from the left of "awk --source='", to the end quote "'", but the automatic indentation that is usually in effect in `awk' mode is totally screwed up. It left-justifies every line, no matter what the content, i.e. if-then statements are not indented correctly. I know that in the FAQ it mentions that "often this sort of problem can be fixed by adding elements to `mmm-save-local-variables'". I'm fully prepared to look into this, but it would be nice to know what variables may or may not be relevant to look at, in the context of indentation. test_fun() { awk --source=' BEGIN {} for (i=0; i<test; i++) { print "something"; } $5 ~ /^sfdsdf$/ { print "echo"; } $6 ~ /5/ && $3 !~ /4[gh]4/ { print "no echo"; } ' } # Local variables: # mmm-classes: embedded-awk # End: I'm using the pretest version of GNU Emacs 21 (emacs-21.0.91.1) with mmm-0.4.6. I will attempt to duplicate the problem in GNU Emacs 20.7, to see if this is an incompatibilty problem with Emacs 21, but I wanted to see if MMM and the bleeding-edge of Emacs would work together, since I expect that Emacs 21 will be out real soon now... Thanks, Alex -- Alex Lancaster * al...@us... * SourceForge Developer |