Find of the week - two-mode-mode

I just came across two-mode-mode when looking for some xemacs extensions for editing ruby on rails code, and it is awesome.

The basic problem is one that anyone editing PHP, or even HTML with embedded CSS or Javascript has run into. Your editor locks to HTML editing mode, with indentation and font coloring for it, great. Then you get into your code block which is really a different language, and you no longer have an editing mode appropriate to the lines you are changing. Along comes two-mode-mode (or probably better called multi-mode-mode). The primary mode is HTML. Any time you enter blocks that look like something else (i.e. CSS, Javascript, Ruby, PHP, Python) emacs changes modes, re-font-locks, and life is good. You exist the block, and emacs flips you back to HTML mode.

I made a couple minor changes so that PHP mode used PHP, and CSS and Javascript modes were also detected. There were also 2 functions that xemacs didn’t know about, but a quick m-x appropos let me find close enough versions for xemacs. Things like this are another reason I just love xemacs. :)

Popularity: 25% [?]

One Response to “Find of the week - two-mode-mode”

  1. David N. Welton Says:

    You might consider trying to make your changes ‘generic’ (if xemacs …) and feeding them back to me so that other people can benefit from them.

    Ciao,
    Dave

Leave a Reply


This blog uses the cross-linker plug-in developed by thruSITES web design company