C Comment in Emacs - Linux Kernel Style

I use

(setq-default comment-style 'multi-line)

and comments in my region on execution M-;:

/* void main()
 * {
 *  int i;
 *  int b;
 *  printf("format string");
 * } */

But I want them to look like this:

/* 
 * void main()
 * {
 *  int i;
 *  int b;
 *  printf("format string");
 * }
 */

What do i need to change?

+4
source share
2 answers

Try:

(setq comment-style 'extra-line)
+7
source

Complementing the answer of anler and answering my own question.

To use the Linux Linux kernel [1] comment style in emacs, simply set this variable to your .emacs / init.el:

(setq comment-style 'extra-line)

To comment / uncomment, use - after selecting an area. M;

, . C Emacs - Linux Kernel Style v2.

[1] https://www.kernel.org/doc/Documentation/CodingStyle

0

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


All Articles