From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: How to use c-style to comment a region? Date: 10 May 2007 23:14:01 +0200 Message-ID: <20070510223600.GA4176@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1178831663 20409 80.91.229.12 (10 May 2007 21:14:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 May 2007 21:14:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: William Xue Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 10 23:14:22 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HmFxs-0003Id-NO for ged-emacs-devel@m.gmane.org; Thu, 10 May 2007 23:14:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmG5C-00016F-9j for ged-emacs-devel@m.gmane.org; Thu, 10 May 2007 17:21:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HmG52-0000ww-CI for emacs-devel@gnu.org; Thu, 10 May 2007 17:21:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HmG50-0000wX-S9 for emacs-devel@gnu.org; Thu, 10 May 2007 17:21:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmG50-0000wS-Ob for emacs-devel@gnu.org; Thu, 10 May 2007 17:21:42 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HmFxe-0002tR-Dx for emacs-devel@gnu.org; Thu, 10 May 2007 17:14:06 -0400 Original-Received: (qmail 56386 invoked by uid 3782); 10 May 2007 21:14:02 -0000 Original-Received: from acm.muc.de (p54A3DA0B.dip.t-dialin.net [84.163.218.11]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 10 May 2007 23:14:00 +0200 Original-Received: (qmail 5312 invoked by uid 1000); 10 May 2007 22:36:00 -0000 Original-Date: Thu, 10 May 2007 23:36:00 +0100 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:70780 Archived-At: 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).