GNU bug report logs - #8150
23.2; cperl-uncomment-region is NOT an inverse of cperl-comment-region

Previous Next

Package: emacs;

Reported by: Dima Kogan <dkogan <at> cds.caltech.edu>

Date: Wed, 2 Mar 2011 08:53:01 UTC

Severity: minor

Found in version 23.2

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lawrence Mitchell <wence <at> gmx.li>
To: 8150 <at> debbugs.gnu.org
Subject: bug#8150: 23.2; cperl-uncomment-region is NOT an inverse of cperl-comment-region
Date: Fri, 17 Feb 2012 12:47:10 +0000
I'm chasing up open bugs I've participated in, probably too late
for 24.1, but just to see if anything's doing.  Is there any
objection to applying the patch in this bug report?

Lawrence Mitchell wrote:

[...]

> Note that the problem is that (uncomment-region A B 1) is not the
> inverse of (comment-region A B 1).  Irrespective of the major
> mode in effect:

> emacs -Q

> C-x h
> C-1 M-x comment-region RET
> C-x h
> C-1 M-x uncomment-region RET

> Note how there is now a space at the beginning of every line in
> the *scratch* buffer.

> This is due to the following code in uncomment-region-default:

> |	  (if (null arg) (delete-region (point-min) (point))
> |	    (skip-syntax-backward " ")
> |	    (delete-char (- numarg))

>    # foo bar
>      ^ point is here when the above code is called.

> If an argument is supplied, arg is non-nil and so to delete the
> comment we first move backwards over whitespace and then delete
> as many comment characters as specified by the argument (1 in
> this case).





This bug report was last modified 13 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.