简体   繁体   English

Emacs 中的双模模式更好的压痕

[英]Better indentation in two-mode-mode in Emacs

I am using Emacs to modify code which is interleaving Perl and Verilog.我正在使用 Emacs 来修改将 Perl 和 Verilog 交错的代码。 I am using two-mode-mode to switch between the two, which works as expected.我正在使用two-mode-mode在两者之间切换,这可以按预期工作。 The problem is that the perl code is indicated on a line by line basis with //;问题是 perl 代码用//;逐行表示。 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.虽然双模式模式识别出它是 Perl,但它是逐行执行的,因此缩进等跨行没有意义。

What I would like to do is have the Perl code be formatted as usual, but ignoring the //;我想做的是像往常一样格式化 Perl 代码,但忽略//; characters (they should just be left alone at the start of the line, then the Perl formatted as usual).字符(它们应该单独留在行首,然后像往常一样格式化 Perl)。 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 http://www.emacswiki.org/emacs/MultipleModes

AFAIK, mumamo is the most active one these days. AFAIK,mumamo 是当今最活跃的一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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