From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: c-style comments in c++-mode Date: Tue, 13 Feb 2007 10:11:03 -0500 Message-ID: References: <45cf8c31$0$5718$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171379530 17844 80.91.229.12 (13 Feb 2007 15:12:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Feb 2007 15:12:10 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Ankur Jain" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 13 16:12:03 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HGzK5-0007Xa-Ns for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2007 16:12:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGzK4-0005yS-TH for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Feb 2007 10:12:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGzJH-0005ld-74 for help-gnu-emacs@gnu.org; Tue, 13 Feb 2007 10:11:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGzJF-0005kp-6m for help-gnu-emacs@gnu.org; Tue, 13 Feb 2007 10:11:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGzJE-0005kk-Pv for help-gnu-emacs@gnu.org; Tue, 13 Feb 2007 10:11:08 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGzJE-0002YP-HV for help-gnu-emacs@gnu.org; Tue, 13 Feb 2007 10:11:08 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id EDC162CF1F3; Tue, 13 Feb 2007 10:11:07 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 34D7E3FE1; Tue, 13 Feb 2007 10:11:03 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 1F7936C48E; Tue, 13 Feb 2007 10:11:03 -0500 (EST) In-Reply-To: (Ankur Jain's message of "Tue\, 13 Feb 2007 19\:58\:30 +0530") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-0.6, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_HTTPSTR 2.22) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41169 Archived-At: > Can we use both style of comments, somehow. Of course. You can always insert the other style by hand, for example. > I mean, instead of replacing c++ mode comments completely, can we assign > keyboard shortcut for inserting c mode style comments? Or may be some other > better method to use both styles. Sure. Coding it is trivial. The difficult aspect is to find a convenient user interface for it. The difficulty is that it should be more convenient than doing the edit by hand, which is often pretty simple to do. Maybe a good feature would be a toggling function that changes the style of the comment-around-point. That would be a bit less trivial to code. Stefan > On 2/12/07, Stefan Monnier wrote: >> >> >>> What's the quickest way to tell c++-mode to insert c-style comments? >> >> (add-hook 'c++-mode-hook >> >> (lambda () (setq comment-start "/* ") (setq comment-end " >> */"))) >> > Or with a CC Mode style ... >> >> Probably, but I use too many major modes to be bothered to learn each and >> every one's new idiosyncratic way to configure it. Especially since Emacs >> provides perfectly good generic ways to do that. >> >> >> Stefan >> _______________________________________________ >> help-gnu-emacs mailing list >> help-gnu-emacs@gnu.org >> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs >> > -- > Regards > Ankur Jain > http://ankurjain.org