Filling comments in Emacs C / C ++: want paragraphs in comments not to merge

Enter

// This is an example, a test, of what I want emacs filling, in this case of C++ comments, to do. // This is a paragraph that needs to get filled. // But I want to start a new paragraph, within the same comment, that is indented, // but not joined to the previous by filling. // And another. 

Here is what I get with my current settings. I do not want this. He joins the paragraphs.

 // This is an example, a test, of what I want emacs filling, // in this case of C++ commentrs to do. This is a paragraph // that needs to get filled. But I want to start a new // paagraph, within the same comment, that is indented, but // not joined the the previous by filling. And another. 

That's what i want

 // This is an example, a test, of what I want emacs filling, // in this case of C++ comments to do. This is a paragraph // that needs to get filled. // But I want to start a new paragraph, within the same // comment, that is indented, but not joined to the previous // by filling. // And another. 

Using adaptive fill.

Gnu emacs 24.1.1


Someone asked: "How does emacs distinguish your non-standard paragraph marker from a user who was a bit messy with spaces? The standard marker for a new paragraph is an empty line."

There are emacs modes that can correctly fill paragraphs with standard English indentation, where the first line of new paragraphs has more indentation than bodies close to them.

 This is an example, a test, of what I want emacs filling, in this case of non-comments to do. This is a paragraph that needs to get filled. But I want to start a new paragraph, within the same comment, that is indented, but not joined to the previous by filling. And another. 

All I want to do is expand this to an extra indent that has passed the fill prefix.

+4
source share
1 answer

You can control this with regex variables. you can probably get him to do what you want, but it's a bit of an β€œart."

0
source

Source: https://habr.com/ru/post/1438092/


All Articles