unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How add "#" to blank lines when using py-comment-region???
@ 2003-08-12 19:24 Christian Seberino
  2003-08-12 20:30 ` lawrence mitchell
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Seberino @ 2003-08-12 19:24 UTC (permalink / raw)


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?

Chris

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

* Re: How add "#" to blank lines when using py-comment-region???
  2003-08-12 19:24 How add "#" to blank lines when using py-comment-region??? Christian Seberino
@ 2003-08-12 20:30 ` lawrence mitchell
  2003-08-13 18:15   ` Christian Seberino
  0 siblings, 1 reply; 3+ messages in thread
From: lawrence mitchell @ 2003-08-12 20:30 UTC (permalink / raw)


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.

-- 
lawrence mitchell <wence@gmx.li>

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

* Re: How add "#" to blank lines when using py-comment-region???
  2003-08-12 20:30 ` lawrence mitchell
@ 2003-08-13 18:15   ` Christian Seberino
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Seberino @ 2003-08-13 18:15 UTC (permalink / raw)


Lawrence

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()
      (turn-on-font-lock)
      (setq comment-empty-lines t) )


What am I doing wrong?
Thanks!

Chris 


lawrence mitchell <wence@gmx.li> wrote in message news:<?fnord?u1xvqaaba.fsf@ID-97657.usr.dfncis.de>...
> 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.

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

end of thread, other threads:[~2003-08-13 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-12 19:24 How add "#" to blank lines when using py-comment-region??? Christian Seberino
2003-08-12 20:30 ` lawrence mitchell
2003-08-13 18:15   ` Christian Seberino

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).