help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c-like comments settings


From: Luca Ferrari
Subject: c-like comments settings
Date: Thu, 3 Jan 2013 20:45:27 +0100

Hi all,
this is surely trivial but I don't know how to do it. I'd like to know
if it is possible to configure the comments (M-;) in c and c-based
modes (e.g. php) to do the following:

1) if a comment is started on a blank line to open it with a
decorator, so that the following

    /* here-the-cursor */

becomes like the following:

   /*
    * here-the-cursor
    */

but keeping the normal commenting for code lines as follows:

   int my_variable:  /* here the cursor within comment with no decorators */

2) to indent comments so that are all aligned depending on the
rightmost one, so that the following:

    int a_very_long_variable_name = 0; /* comment 1 */
    int i = 2; /* comment */

becomes like the following:

    int a_very_long_variable_name = 0; /* comment 1 */
    int i = 2;                                             /* comment */

3) if it is possible to activate a kind of electric "/" when editing a
comment so that a "/" on an empty line will automatically
close the comment so that the following:

/*
 * blah
 * blah
 * /

is translated to

/*
 * blah
 * blah
 */

Any hint is appreciated.

Thanks,
Luca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]