From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Newsgroups: gmane.emacs.help Subject: Re: comments in cc mode Date: Sat, 22 May 2010 09:20:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: <803a9456-e1ed-433b-b660-df186b066249@z17g2000vbd.googlegroups.com> References: <4ACDABA4.7070402@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291834045 23243 80.91.229.12 (8 Dec 2010 18:47:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 18:47:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 19:47:21 2010 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.69) (envelope-from ) id 1PQP2t-00058T-EH for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 19:47:19 +0100 Original-Received: from localhost ([127.0.0.1]:51772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQP2s-0003b1-T2 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 13:47:18 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!z17g2000vbd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Original-NNTP-Posting-Host: 93.125.167.94 Original-X-Trace: posting.google.com 1274545214 18816 127.0.0.1 (22 May 2010 16:20:14 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 22 May 2010 16:20:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z17g2000vbd.googlegroups.com; posting-host=93.125.167.94; posting-account=eSv9jAoAAABOki9g4H1AstlVmnvbkn8_ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.9) Gecko/20100317 SUSE/3.5.9-0.1.1 Firefox/3.5.9,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:178365 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:75821 Archived-At: Dear Alan, On May 22, 11:43=A0am, Alan Mackenzie wrote: > Hi, Michael, > > "Massmann, M. (Michael)" wrote: > > > Dear Andreas, > > Many thanks for this. Could you point me to the documentation for the > > options available for comment-style? After playing around with some of > > them I did not get the desired effect. > > I also had a look at cc-mode's `c-indent-comment-alist' and set every > > single entry to `column' and `nil', so as to have the default column > > (ie 100) apply, no matter what the surrounding syntax is. The variable > > `c-indent-comments-syntactically-p' I set to nil so that it does not > > override the previous settings. > > This seems to have the desired effect that when I press M-; to insert a > > *new* comment on a line, empty or not, the comment indeed starts in > > column 100. > > Yet when I press M-; to re-align an *existing* comment, the entire > > comment is moved to a column other than 100 in 9 out of 10 cases. > > Any advice on how to rectify this problem would be appreciated. Thanks! > > I've just gone through `comment-dwim' in edebug (the Emacs debugger), and > it seems like comments are being made to fit within `fill-column'. =A0I > don't know why this is being done, but could you try setting it to a high > value, say > > =A0 =A0 (setq fill-column 150) > > . =A0Does this solve the immediate problem? =A0Does it introduce any new > problems? > > > Regards, > > Michael > > -- > Alan Mackenzie (Nuremberg, Germany). Many thanks for your suggestion! This was precisely what was going pear-shaped. I did have my fill-column at 150 to start with, but some of my comments were more than 50 characters long, and they seem to have been shifted left such that they ended on column 150. I have now increased fill-column to 200 and everything works beautifully. One more question if I may: is there an easy way to tell Emacs to automatically set fill-column to 200 when in cc-mode and to leave it at 150 otherwise (eg when loading auctex)? Column 200 is off my screen and it is only with code comments that this doesn't bother me. Thanks again for your help, Michael