From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Belliveau Newsgroups: gmane.emacs.help Subject: Re: c-mode comment indent alignment issue Date: Thu, 25 Apr 2013 20:12:39 -0400 Message-ID: <8CA95C77-BC88-41F8-A5EA-218FB0DEBA8E@comcast.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1366935170 2523 80.91.229.3 (26 Apr 2013 00:12:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 00:12:50 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 26 02:12:53 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UVWHU-0006sv-5V for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Apr 2013 02:12:52 +0200 Original-Received: from localhost ([::1]:44289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVWHT-0001Na-O6 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Apr 2013 20:12:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVWHH-0001NS-3U for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 20:12:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVWHE-0005B0-FN for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 20:12:39 -0400 Original-Received: from qmta02.westchester.pa.mail.comcast.net ([76.96.62.24]:60636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVWHE-0005Aw-Bd for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 20:12:36 -0400 Original-Received: from omta23.westchester.pa.mail.comcast.net ([76.96.62.74]) by qmta02.westchester.pa.mail.comcast.net with comcast id UAVl1l0021c6gX851QCb7X; Fri, 26 Apr 2013 00:12:35 +0000 Original-Received: from [10.0.1.3] ([76.119.172.160]) by omta23.westchester.pa.mail.comcast.net with comcast id UQCb1l0083TzthY3jQCbPE; Fri, 26 Apr 2013 00:12:35 +0000 In-Reply-To: X-Mailer: Apple Mail (2.1503) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366935155; bh=E9wwCZv2IJKaxdqor9h+8mjCgk8oh0SPszXz4fmMnPc=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=R+QFZhnOsqnizbmCYn1r++HIJ6Fk3q52b3iioTyfNsDE3clVAAwLZt/tgEyVVT/lz knImfGwIeQAtW9cZbBBtgMb68Roodifunyy1RM6EKwoJEa0XGGSgR4iEsO2b9Oub3O VqiE9NhPVpO4cT0xdGhyhtFcpzoWDl9Z+RsMqSaxWBVUlbtsUU+MqphKQZPxxaeqhA i1WJGruw3Yo+E0wRxtkHO9tlATgYrP3h8SifvvxYmZSqm3tE6r805k1GsLs8XlrX4f 4nbDomvB3n+s0U3fim8A6RB3sJtkWJKVA8dUnW271AqDVpBM/fs1qD9RBPKN0HSq4Y +25yC/0icKnBQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 76.96.62.24 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90352 Archived-At: Thanks to Alan I can at least create a work-around by changing to /* * **** * * Sample=85 * * **** */ I found the function "c-lineup-C-comments" to complicated for me to = quickly modify. I would actually like to hear from those who would like a reasonable = modification to the logic as follows: "If the line following the comment open contains all the same = "non-alpha-numeric" character then that becomes the controlling line" That would mean that" /* ** Text */ Continues to work as before but /* ** ** Text ** */ Stays indented. Does anybody else have a strong opinion about this? Fran On Apr 24, 2013, at 7:56 AM, Alan Mackenzie wrote: > Francis Belliveau wrote: >> I am having trouble figuring out how to control comment indentation = and >> alignment. Consider the following sequence of comments: >=20 >> /***** >> * >> * @file foo.h >> * >> ***** >> */ >> /* >> * $Revision$ >> * >> ***** >> */ >> /* >> ***** >> * >> * Sample... >> * >> ***** >> */ >=20 >> In c-mode when they are all in the region and I "indent-region", the >> first two comments don't change, but the content of the last comment >> gets jammed against the left edge. >=20 >> If I put a " *" before the upper row of asterisks all is okay. >=20 >> Can anybody tell me how I can take control of the comment indentation >> logic to stop the indentation from being eliminated? >=20 > This is difficult. The critical line which determines the indentation > of the entire comment is the second line, thus: >=20 > /* > ***** <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > .... >=20 > If the number of asterisks is greater than the number in the "/***" > comment opener, the second line is "aligned left" under the "/***". > (This is what you don't like here.) Otherwise, like in the "foo.h" > and "$Revision$" comments, it is "aligned right". The thinking behind > this left alignment is to indent this case: >=20 > /* > ** Text. > ** Text. > */ >=20 > This is all done by the lisp function `c-lineup-C-comments'. Adapting > this function to change this behaviour could give you the result you = want. > Instructions for doing this are on page "Custom Line-Up" of the CC = Mode > manual. >=20 > Sorry I can't be more helpful. >=20 >> Fran >=20 > --=20 > Alan Mackenzie (Nuremberg, Germany). >=20