unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Comments always aligned at column 67 despite comment-column set otherwise
@ 2010-03-23 13:34 eric_powell
  2010-03-23 21:31 ` Jeff Clough
  0 siblings, 1 reply; 6+ messages in thread
From: eric_powell @ 2010-03-23 13:34 UTC (permalink / raw)
  To: Help-gnu-emacs


I am new to emacs and really love the customizability, but on one front I
have grown really confused and frustrated.  

All I would like to be able to do is set the comment column and then when I
press M-;, for a comment to appear at that column.  I am trying to do this
by setting the variable set-comment-column.  Seems simple enough, but no
matter where I set this value, the comment always appears at column 67. 

Furthermore, the M-; command is supposed to also realign existing comments,
but in that case, it moves the comments to a completely different column
(neither 67 nor what I set it to).

This problem is absolutely driving me crazy.  Please someone help.

I am mostly using emacs for c++ code, which I think is using cc-mode with
the gnu style, but it would be nice if I could configure this behavior also
for perl and bash code.  
-- 
View this message in context: http://old.nabble.com/Comments-always-aligned-at-column-67-despite-comment-column-set-otherwise-tp28000835p28000835.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comments always aligned at column 67 despite comment-column set otherwise
  2010-03-23 13:34 Comments always aligned at column 67 despite comment-column set otherwise eric_powell
@ 2010-03-23 21:31 ` Jeff Clough
  2010-03-24 13:08   ` eric_powell
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Clough @ 2010-03-23 21:31 UTC (permalink / raw)
  To: Help-gnu-emacs

eric_powell <epowell1@med.miami.edu> writes:

> All I would like to be able to do is set the comment column and then when I
> press M-;, for a comment to appear at that column.  I am trying to do this
> by setting the variable set-comment-column.  Seems simple enough, but no
> matter where I set this value, the comment always appears at column 67. 

The variable is actually named "comment-column".  You can test and/or
play around with it by doing a M-: and typing

(setq comment-column n)

Where n is the column number.  It should make M-; work as expected.
Once you find a number that works for you, you'll probably need to use
customize in order to make it permanent (it's buffer local).  You can
most easily do that by doing describe-variable on comment-column with
C-h v, then clicking the "customize" link near the bottom of the help.

> Furthermore, the M-; command is supposed to also realign existing comments,
> but in that case, it moves the comments to a completely different column
> (neither 67 nor what I set it to).

This also works with comment-column set as I noted above.

> This problem is absolutely driving me crazy.  Please someone help.
>
> I am mostly using emacs for c++ code, which I think is using cc-mode with
> the gnu style, but it would be nice if I could configure this behavior also
> for perl and bash code.  

It should.

Jeff




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comments always aligned at column 67 despite comment-column set otherwise
  2010-03-23 21:31 ` Jeff Clough
@ 2010-03-24 13:08   ` eric_powell
  2010-03-24 13:25     ` eric_powell
  2010-03-24 13:25     ` Jeff Clough
  0 siblings, 2 replies; 6+ messages in thread
From: eric_powell @ 2010-03-24 13:08 UTC (permalink / raw)
  To: Help-gnu-emacs


Thanks for the reply, Jeff.  

What you suggested is very similar to what I was doing.  (I guess I was
actually using the set-comment-column command to set the comment-column
variable).  

Nevertheless, the result was the same.  I set the comment-column to 77,
pressed M-;, and a comment appeared at column 67!?!? (BTW, I pressed M-; on
a line with text on it already [e.g. int i = 0; ]).

At this point, I am trying to understand what could be overriding the
comment-column.  I read about a user option called c-indent-comment-alist. 
I can't seem to access it anymore, but I used to be able to, and I think it
could be somehow culpable.  Also, I understand that the particular c-style
I'm using could be involved.  Either way, I can't seem to decipher what
these other options may or may not be doing.

Does anyone know which options/settings could be over-riding what I have
most certainly set as the comment-column?

-- 
View this message in context: http://old.nabble.com/Comments-always-aligned-at-column-67-despite-comment-column-set-otherwise-tp28000835p28014762.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comments always aligned at column 67 despite comment-column set otherwise
  2010-03-24 13:08   ` eric_powell
@ 2010-03-24 13:25     ` eric_powell
  2010-03-24 13:43       ` Jeff Clough
  2010-03-24 13:25     ` Jeff Clough
  1 sibling, 1 reply; 6+ messages in thread
From: eric_powell @ 2010-03-24 13:25 UTC (permalink / raw)
  To: Help-gnu-emacs


It seems that the plot has thickened slightly.  I discovered that my troubles
only arise when trying to set the comment-column PAST column 67.  If I set
it to 50, for example, the comments will appear on col. 50, but if I set it
to anything greater than 67, the comments still appear at 67.  
Does this provide any more clues to what could be afoot?

-- 
View this message in context: http://old.nabble.com/Comments-always-aligned-at-column-67-despite-comment-column-set-otherwise-tp28000835p28014831.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comments always aligned at column 67 despite comment-column set otherwise
  2010-03-24 13:08   ` eric_powell
  2010-03-24 13:25     ` eric_powell
@ 2010-03-24 13:25     ` Jeff Clough
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Clough @ 2010-03-24 13:25 UTC (permalink / raw)
  To: Help-gnu-emacs

eric_powell <epowell1@med.miami.edu> writes:

> Does anyone know which options/settings could be over-riding what I have
> most certainly set as the comment-column?

Did you try setting comment-column via customize?  I haven't played
around with customize much, but I hear tell that Emacs can be surly
about setq-ing things out from under it.  It's possible (though I don't
know), that this is the cause for the oddness.

If that's not it, then I have no idea what's going on. :(

Jeff




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comments always aligned at column 67 despite comment-column set otherwise
  2010-03-24 13:25     ` eric_powell
@ 2010-03-24 13:43       ` Jeff Clough
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Clough @ 2010-03-24 13:43 UTC (permalink / raw)
  To: eric_powell; +Cc: Help-gnu-emacs

eric_powell <epowell1@med.miami.edu> writes:

> It seems that the plot has thickened slightly.  I discovered that my troubles
> only arise when trying to set the comment-column PAST column 67.  If I set
> it to 50, for example, the comments will appear on col. 50, but if I set it
> to anything greater than 67, the comments still appear at 67.  
> Does this provide any more clues to what could be afoot?

Umm...yeah.  I wish I had seen that sooner.  Try setting fill-column to
something greater.  It's buffer local too and customizable.  I just
tested it with the values you give and it seems to fix this particular
problem.  If you set comment-column out beyond fill-column, you get the
behavior you describe.

I don't have any experience working with Emacs when you have a very wide
frame.  From what I've seen, there's more magic you need to do to make
everything work than just resizing the frame.  I could be wrong, but if
that's the case there's likely one true way to tell Emacs I want my
frame to be X characters wide and make everything work.

Sorry I didn't get that sooner for you.

Jeff




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-24 13:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23 13:34 Comments always aligned at column 67 despite comment-column set otherwise eric_powell
2010-03-23 21:31 ` Jeff Clough
2010-03-24 13:08   ` eric_powell
2010-03-24 13:25     ` eric_powell
2010-03-24 13:43       ` Jeff Clough
2010-03-24 13:25     ` Jeff Clough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).