logo       

Re: C Mode Comments: msg#00947

emacs.help

Subject: Re: C Mode Comments

I am running GNU Emacs 20.2.3. M-; does not run comment-dwim, but runs
indent-for-comment.

What I am looking for is a command that would have the effect of killing
an entire comment. For example, given:

int x; /* this is a comment */

Only "int x;" would remain on this line of code.

Thanks.

On 19 Dec 2002, Jiri Pejchal wrote:

> Kevin Dziulko <dziulko@xxxxxxxxxxxxxxxxxxx> writes:
>
> > Does anyone know if there is a command to mark a comment, or kill a
> > comment in c-mode?
> >
> > Thanks much.
>
> Try M-; which runs the command comment-dwim.
>
> Mark a region (with M-h or whatever) then M-;
> to comment region.
>
> Do the same one more time to uncomment the region.
>
> Call the comment command you want (Do What I Mean).
> If the region is active and `transient-mark-mode' is on, call
> `comment-region' (unless it only consists of comments, in which
> case it calls `uncomment-region').
> Else, if the current line is empty, insert a comment and indent it.
> Else if a prefix ARG is specified, call `comment-kill'.
> Else, call `comment-indent'.
>
> Jiri Pejchal
>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise