emacs-devel
[Top][All Lists]
Advanced

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

Re: How to use c-style to comment a region?


From: Alan Mackenzie
Subject: Re: How to use c-style to comment a region?
Date: 10 May 2007 23:14:01 +0200
Date: Thu, 10 May 2007 23:36:00 +0100
User-agent: Mutt/1.5.9i

Hi, William!

On Thu, May 10, 2007 at 09:46:34AM +0800, William Xue wrote:
> Hi,

> In cpp files, in following code, for e.g.:

> ln_time_out.QuadPart = -((LONGLONG) 10 * 1000 * 1000 * 5);

> I wanted to modify the second 1000 to 2000 for testing, but wanted to
> keep  the orignal value for restoring it later.

> after selected 1000 and pressed C-c C-c :

>                 ln_time_out.QuadPart = -((LONGLONG) 10 * 1000 * // 1000
>                                          * 5); // 1 second

> Can it be:

>                 ln_time_out.QuadPart = -((LONGLONG) 10 * 1000 * /* 1000  
> */  * 5); // 1 second

> Maybe there are some settings for it, but I havn't found them.

No, there aren't any such settings.

> I know that add /* -*- C -*- */ at the beginning of the file can affect  
> the comment style for the whole file.
> That's not my request, I only want a command or a keybinding.

No, you certainly wouldn't want to have to use C mode just to get the
right sort of comments.

Some while ago, a CC Mode user requested a feature to toggle the type of
comment that M-; inserts within C Mode (i.e. /* ... */  <->  // ... \n).
I intend to write a new command to do just this, probably binding it to
C-c C-;.  This will hopefully get implemented in CC Mode 5.32, which I am
hoping to release shortly after both Emacs 22.1 and GPLv3 are done.

> Thanks!

> Sincerely yours,
> William

-- 
Alan Mackenzie (Ittersbach, Germany).




reply via email to

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