[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M-- comment-region doesn't remove comment-padding when no more comme
From: |
Stefan Monnier |
Subject: |
Re: M-- comment-region doesn't remove comment-padding when no more comment chars |
Date: |
Tue, 09 Nov 2004 19:07:06 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
> In Emacs 20, M-- comment-region effectively undid the operation of
> comment-region, if given the right number as prefix arg. In Emacs 21, this
> is no longer the case.
> In Emacs 21, the comment chars are removed by M--, but the comment-padding
> is never removed. This requires users to perform an extra step of M-- C-x
> TAB to remove the extra padding inserted by comment-region.
> Example:
> C-u 5 comment-region on these lines in Emacs-Lisp mode:
> xxxxxxxx
> yyyyyyyy
> zzzzzzzz
> Result:
> ;;;;; xxxxxxxx
> ;;;;; yyyyyyyy
> ;;;;; zzzzzzzz
> M-- 5 comment-region results in this:
> xxxxxxxx
> yyyyyyyy
> zzzzzzzz
> It should result in the original text:
> xxxxxxxx
> yyyyyyyy
> zzzzzzzz
Yes, it's a known "bug". IIRC it hasn't been fixed because OT1H there wasn't
an easy way to fix it (i.e. it would make the code even more unmanageable),
and OTOH C-u M-x comment-region works as well. I.e. the code assumes that
if you provide a negative numeric prefix you want to remove some but not all
the comment chars, since otherwise you'd have used C-u.
Stefan