简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM