62

I would like to write an Emacs major mode for a 4GL. Can someone show me a tutorial? As far as I googled I was able to find only this broken:

link http://two-wugs.net/emacs/mode-tutorial.html

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Prabu
  • 2,313
  • 2
  • 28
  • 31
  • 5
    What would be *really* nice would be to have a language mode generator from a syntax specification written in BNFC. Is there any work in this area? – Rob Stewart Aug 29 '14 at 16:35

1 Answers1

23

If you're lazy, one easy way is to extend generic-mode to know about your new language:

http://emacswiki.org/emacs/GenericMode

I do this a lot for config files for applications that I work with a lot to get decent syntax highlighting. Here's one I did for the asterisk PBX a long time ago as an example.

nephewtom
  • 2,941
  • 3
  • 35
  • 49
bmdhacks
  • 15,841
  • 8
  • 34
  • 55