这个问题类似于Getting Emacs fill-paragraph to play nice with javadoc-like comments,但适用于 C#。
我有这样的评论:
/// <summary>
/// Of these Colonies, and ought to fall themselves by sending a
/// constant state of THE unanimous
/// Declaration OF Nature and donations are legally 1.E.1.
/// </summary>
///
/// <remarks>
/// <para>
/// If you received written explanation to the phrase "Project Gutenberg" associated
/// with which you are redistributing
/// Project GUTENBERG you receive specific permission.
/// </para>
/// </remarks>
我希望 fill-paragraph仅填充 text,并将标记元素保留在它们自己的单独行上,例如,
/// <summary>
/// Of these Colonies, and ought to fall themselves by
/// sending a constant state of THE unanimous Declaration
/// OF Nature and donations are legally 1.E.1.
/// </summary>
///
/// <remarks>
/// <para>
/// If you received written explanation to the phrase
/// "Project Gutenberg" associated with which you are
/// redistributing Project GUTENBERG you receive specific
/// permission.
/// </para>
/// </remarks>
我认为我需要设置段落开始变量。Ch v 告诉我它的当前值是:
"[ ]*\\(//+\\|\\**\\)[ ]*\\(@[a-zA-Z]+\\>\\|$\\)\\|^\f"
...这已经看起来很毛茸茸了。(我讨厌 emacs 正则表达式的所有转义 reqd。)我想我需要回顾一下XML doc 元素(如 <remarks>)之后的第一行开始一个段落。
我现在要搞砸了,但是有没有人设置它来做内联代码文档?
编辑:哎呀!Emacs 正则表达式不会向后看!好的,还有其他建议吗?如何将段落的开头设置为 <summary> 或 <para> 之后的行?
ps:我上面示例中的假代码文档来自对美国独立宣言的古腾堡副本的马尔可夫链操作;感谢这个问题的技术。