From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: How to use c-style to comment a region? Date: Thu, 10 May 2007 23:40:24 +0200 Message-ID: <46439148.4040505@gmx.at> References: <4642DCCC.2020003@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1178833280 25850 80.91.229.12 (10 May 2007 21:41:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 May 2007 21:41:20 +0000 (UTC) Cc: William Xue , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 10 23:41:17 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 1HmGNx-0000Bg-31 for ged-emacs-devel@m.gmane.org; Thu, 10 May 2007 23:41:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmGVI-0006Ps-Cz for ged-emacs-devel@m.gmane.org; Thu, 10 May 2007 17:48:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HmGVE-0006LS-DQ for emacs-devel@gnu.org; Thu, 10 May 2007 17:48:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HmGVC-0006JV-RL for emacs-devel@gnu.org; Thu, 10 May 2007 17:48:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HmGVC-0006JS-O7 for emacs-devel@gnu.org; Thu, 10 May 2007 17:48:46 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HmGNq-0005Ty-Bt for emacs-devel@gnu.org; Thu, 10 May 2007 17:41:10 -0400 Original-Received: (qmail invoked by alias); 10 May 2007 21:41:08 -0000 Original-Received: from N888P005.adsl.highway.telekom.at (EHLO [62.47.54.229]) [62.47.54.229] by mail.gmx.net (mp048) with SMTP; 10 May 2007 23:41:08 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18/6elM4y4/+aNbOvUtUYfaV5J/ggBKTuit49Wx7j jUtBbmvkRQAcaV User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:70781 Archived-At: > I'm not sure I understand the problem (and hence the solution). Can you > show me a recipe to reproduce this problem? Sorry for being cryptic. With emacs -Q customize `comment-style' to box or box-multi. In *scratch* insert (foo bar baz) set the region around bar and do `comment-region'. Gets you (foo ;; bar ;; baz) instead of (foo ;; bar ;; baz) Responsible is the (when block (unless ce (setq ce (comment-string-reverse cs)))) line in `comment-region-internal' which makes the subsequent (unless (or ce (eolp)) (insert "\n") (indent-according-to-mode)) fail. Obviously it fails in the cpp example of the OP as well.