In Visual Studio, editing a C# file, when I type in three slashes in succession, it auto-generates a template for XML code documentation.
Can I get emacs to do something similar?
In Visual Studio, editing a C# file, when I type in three slashes in succession, it auto-generates a template for XML code documentation.
Can I get emacs to do something similar?
Have you looked at yasnippet? It's a pretty extensible template system, with an easy to understand syntax. You could have three ///
bound to the template you want.
I took a shot at implementing some logic to automatically insert XML comments in csharp-mode. I've published it to the EmacsWiki as csharp-mode v0.7.2 I could have done this with yasnippet or some other template package, but I didn't want to tie csharp-mode to a specific template package.
The behavior is that, if you type three slashes (///
), then you get a template for a summary comment;
/// <summary>
/// (point)
/// </summary>
If you then type three slashes after THAT, then you get a remarks section:
/// <summary>
/// Lorem ipsum....
/// </summary>
/// <remarks>
/// <para>
/// (point)
/// </para>
/// </remarks>
That behavior sort of mimics what you get in Visual Studio 2008, when you type 3 slashes. Try it out.