Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Better indentation in two-mode-mode in Emacs

I am using Emacs to modify code which is interleaving Perl and Verilog. I am using two-mode-mode to switch between the two, which works as expected. The problem is that the perl code is indicated on a line by line basis with //; as shown here:

This is verilog code
// This is a verilog comment
//; This is perl code
//;   This is more perl code
This is verilog code again.

While the two-mode-mode recognizes that it's Perl, it does it on a line by line basis, so indentation and such is not meaningful across lines.

What I would like to do is have the Perl code be formatted as usual, but ignoring the //; characters (they should just be left alone at the start of the line, then the Perl formatted as usual). Any ideas of an easy way to do this? I've just started peeking at the mode files and they are understandably complicated, so any hint would be appreciated!

like image 914
Megan Avatar asked May 31 '11 17:05

Megan


1 Answers

You might have better luck with a different multi-mode mode:

http://www.emacswiki.org/emacs/MultipleModes

AFAIK, mumamo is the most active one these days.

like image 145
Chris Avatar answered Nov 11 '22 14:11

Chris