From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "William Xue" Newsgroups: gmane.emacs.devel Subject: Re: How to use c-style to comment a region? Date: Fri, 11 May 2007 10:04:47 +0800 Organization: wv Message-ID: References: <4642DCCC.2020003@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1178849062 1081 80.91.229.12 (11 May 2007 02:04:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 11 May 2007 02:04:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: "martin rudalics" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 11 04:04:20 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 1HmKUV-0007PI-TM for ged-emacs-devel@m.gmane.org; Fri, 11 May 2007 04:04:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmKbs-0002KU-7v for ged-emacs-devel@m.gmane.org; Thu, 10 May 2007 22:11:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HmKbp-0002KP-PU for emacs-devel@gnu.org; Thu, 10 May 2007 22:11:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HmKbn-0002KD-Mk for emacs-devel@gnu.org; Thu, 10 May 2007 22:11:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmKbn-0002KA-Jw for emacs-devel@gnu.org; Thu, 10 May 2007 22:11:51 -0400 Original-Received: from wx-out-0506.google.com ([66.249.82.235]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HmKUQ-0004Ng-2O for emacs-devel@gnu.org; Thu, 10 May 2007 22:04:14 -0400 Original-Received: by wx-out-0506.google.com with SMTP id s17so764894wxc for ; Thu, 10 May 2007 19:04:13 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:to:subject:from:organization:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=chXotEYzTD2AscigiH+2d+D+wo5kjqRJQaIWGBVxFuK38S2FOaYkse6yeQCF/GBVJ59l4PJ5pjl5lkANoe2iZzmNf7gqWhntQUiWLTiLfsPZhHnT1N3LMTEWIxvCzbji7O/8tGS69rfMWEr1nzbwrZa20ZCZzDfD0tTr7Mi704A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:from:organization:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=uZ1B0L6joouZVwdS36HxiCMPB4FWR2gtArtlaEwZeXc/e7cjmPz+e7o7Pv5dHWe4LDncMGcgd+AspNN9Bmcixn55xaREdYmPeqi9W/wG09Ofg72APeLSdytt/lxWz3mfMja8R5qUGTkInuqhuNDZBXUhBU03ETUtsNkw+huH4ws= Original-Received: by 10.90.73.7 with SMTP id v7mr2466292aga.1178849050451; Thu, 10 May 2007 19:04:10 -0700 (PDT) Original-Received: from williamnb ( [222.92.124.222]) by mx.google.com with ESMTP id 8sm11660399agd.2007.05.10.19.04.08; Thu, 10 May 2007 19:04:09 -0700 (PDT) In-Reply-To: <4642DCCC.2020003@gmx.at> User-Agent: Opera Mail/9.20 (Win32) X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) 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:70784 Archived-At: On Thu, 10 May 2007 16:50:20 +0800, martin rudalics wrote: > > That's not my request, I only want a command or a keybinding. > > You could try to bind > > (defun my-cpp-comment-region (beg end &optional arg) > (interactive "*r\nP") > (let ((comment-start "/* ") > (comment-end " */")) > (comment-region beg end arg))) > > to a key. I bind it to C-; and it works very well. Thank you very much! > > BTW with comment-styles box / box-multi and newline terminated comment > syntax `comment-region' comments out the entire text from the beginning > of the region till EOL. The attached patch should cure that. -- Sincerely yours, William