[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How add "#" to blank lines when using py-comment-region???

From: Christian Seberino
Subject: Re: How add "#" to blank lines when using py-comment-region???
Date: 13 Aug 2003 11:15:45 -0700


Thanks for the help.  comment-region is a powerful command useful in
all languages!  I tried to set comment-empty-lines but could not
get blank lines to get commented.

Here is a small .emacs I made to try to comment empty lines when
I do a comment-region command.  It works except for blank lines
in C...

   (setq-default auto-mode-alist
      '(("\\.c\\'"    . c-mode      )
        ("\\.h\\'"    . c-mode      ) ))

   (add-hook 'c-mode-hook 'my-c-mode-hook )

   (defun my-c-mode-hook()
      (setq comment-empty-lines t) )

What am I doing wrong?


lawrence mitchell <address@hidden> wrote in message news:<address@hidden>...
> Christian Seberino wrote:
> > py-comment-region lets me
> > add "#" at beginning of non-blank lines that I have
> > highlighted with mouse.
> > It does not add "#" for the blank lines.
> > How can I modify behavior of py-comment-region to do this?
> py-comment-region is just a minor wrapper around comment-region,
> so the variable you want to look at is comment-empty-lines.
> If you only want to comment blank lines in python mode, you'll
> have to make comment-empty-lines buffer local and set it in a
> hook.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]