bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#8150: 23.2; cperl-uncomment-region is NOT an inverse of cperl-commen


From: Lawrence Mitchell
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
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux)

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






reply via email to

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