[gnu.emacs] NOVICE GNU Emacs questions.

kincaid@cg-atla.UUCP (Tom Kincaid ) (06/01/89)

I am switching from UNIPRESS emacs to GNU. 

The problem I am having is trying to change the comment column.
It is set to 32. Whenever I use the command C-x ; (set-comment-column)
it tells me the comment column has been set to whatever column my
cursor is currently in. However all subsequent M-; (indent-for-comment)
commands still start at column 32. 

Any GURU's out there with a solution ?

jr@bbn.com (John Robinson) (06/03/89)

In article <7075@cg-atla.UUCP>, kincaid@cg-atla (Tom Kincaid ) writes:
>I am switching from UNIPRESS emacs to GNU. 

Congratulations!

>The problem I am having is trying to change the comment column.
>It is set to 32. Whenever I use the command C-x ; (set-comment-column)
>it tells me the comment column has been set to whatever column my
>cursor is currently in. However all subsequent M-; (indent-for-comment)
>commands still start at column 32. 
>
>Any GURU's out there with a solution ?

Don't know if I have it or if I qualify as a GURU (GNURU?), but here's
a couple of ideas.

First of all, comment-column is local to each buffer.  Setting it in
one buffer has no effect on other buffers you may already have on
other files, or on new buffers created when you visit new files.  To
make the default value for buffers that haven't had it set locally be,
say, 40, do (in your .emacs file):

  (setq-default comment-column 40)

[this can't be done interactively with M-X.  If you have it enabled,
M-ESC can swallow the form above.  Or put your cursor after the `)'
character and type C-X C-E]

If you only want it changed for, say, C files, you can hang the setq
form onto the c-mode-hook (see the documentation for c-mode, by typing
C-H f c-mode RET) as follows:

  (setq c-mode-hook '(lambda nil
			     (setq comment-column 40)))

again, in your .emacs.
--
/jr, nee John Robinson   What a waste it is to lose one's mind--or not
jr@bbn.com or bbn!jr      to have a mind.  How true that is. -Dan Quayle