GNU bug report logs - #31615
let uncomment-region remove ALL comment+whitespace chars up to first non-comment char

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 28 May 2018 04:21:01 UTC

Severity: wishlist

Found in version 27.0

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31615 in the body.
You can then email your comments to 31615 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31615; Package emacs. (Mon, 28 May 2018 04:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 28 May 2018 04:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0; doc of `uncomment-region(-default)'
Date: Sun, 27 May 2018 21:20:04 -0700 (PDT)
1. These two functions should not have the same doc string.  Function
`*-default' should say what is - the default value of
`uncomment-region-function'.

2. The doc strings should be much more specific about the behavior, in
particular wrt ARG.  Apparently the functions do nothing at all if ARG
is larger than the first sequence of comment chars in the region.

E.g. for a comment such as this one:

  ;; foo bar

(uncomment-region (line-beginning-position) (line-end-position) 3)

does nothing.  That's not obvious from the doc.  From the doc I'd get
the impression that I could be sure to remove all contiguous comment
chars from the beginning using `most-positive-fixnum' for ARG.

3. The doc string talks about "comment markers".  What's that?

4. Enhancement request: Provide a way to remove ALL comment chars and
all whitespace between them, up to the first non-comment char.  So each
of these lines, for example:

  ;; ;;; ; foo bar

  ; ; ; ; foo bar

  ;; ;; foo bar

  ;; foo bar

would be uncommented to this line:

  foo bar

That could be done, for example, by providing `all' as the value of ARG.


In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
 of 2018-03-21
Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install -C 'CFLAGS=-O2 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31615; Package emacs. (Sat, 02 Jun 2018 10:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 31615 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 31615 <at> debbugs.gnu.org
Subject: Re: bug#31615: 27.0; doc of `uncomment-region(-default)'
Date: Sat, 02 Jun 2018 13:44:59 +0300
> Date: Sun, 27 May 2018 21:20:04 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> 1. These two functions should not have the same doc string.  Function
> `*-default' should say what is - the default value of
> `uncomment-region-function'.

Done.

> 2. The doc strings should be much more specific about the behavior, in
> particular wrt ARG.  Apparently the functions do nothing at all if ARG
> is larger than the first sequence of comment chars in the region.
> 
> E.g. for a comment such as this one:
> 
>   ;; foo bar
> 
> (uncomment-region (line-beginning-position) (line-end-position) 3)
> 
> does nothing.  That's not obvious from the doc.

I'm not sure this was the intent of the code.  I'd expect it to remove
the maximum number of comment delimiters it can, not just punt
silently.

> 3. The doc string talks about "comment markers".  What's that?

It means "comment delimiters"; fixed.

> 4. Enhancement request: Provide a way to remove ALL comment chars and
> all whitespace between them, up to the first non-comment char.

Not done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31615; Package emacs. (Sat, 02 Jun 2018 13:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 31615 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 31615 <at> debbugs.gnu.org
Subject: RE: bug#31615: 27.0; doc of `uncomment-region(-default)'
Date: Sat, 2 Jun 2018 13:47:38 +0000 (UTC)
> Done.

Thx.

> > 2. The doc strings should be much more specific about the behavior, in
> > particular wrt ARG.  Apparently the functions do nothing at all if ARG
> > is larger than the first sequence of comment chars in the region.
> >
> > E.g. for a comment such as this one:
> >   ;; foo bar
> > (uncomment-region (line-beginning-position) (line-end-position) 3)
> > does nothing.  That's not obvious from the doc.
> 
> I'm not sure this was the intent of the code.  I'd expect it to remove
> the maximum number of comment delimiters it can, not just punt
> silently.

I too think that should be the behavior, but who knows what
the intention was.  If the behavior gets fixed to do that
then great.  In any case (fixed behavior, intended but not
yet fixed behavior, or current behavior), I think the
behavior should be documented.

> It means "comment delimiters"; fixed.

Thx.

> > 4. Enhancement request: Provide a way to remove ALL comment chars and
> > all whitespace between them, up to the first non-comment char.
> 
> Not done.

Right.  Shall we leave this bug open for that enhancement
request, or do you want a new report for just that?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31615; Package emacs. (Sat, 02 Jun 2018 14:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 31615 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 31615 <at> debbugs.gnu.org
Subject: Re: bug#31615: 27.0; doc of `uncomment-region(-default)'
Date: Sat, 02 Jun 2018 17:14:14 +0300
> Date: Sat, 2 Jun 2018 13:47:38 +0000 (UTC)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 31615 <at> debbugs.gnu.org
> 
> > > 4. Enhancement request: Provide a way to remove ALL comment chars and
> > > all whitespace between them, up to the first non-comment char.
> > 
> > Not done.
> 
> Right.  Shall we leave this bug open for that enhancement
> request, or do you want a new report for just that?

I left it open.




Changed bug title to 'let uncomment-region remove ALL comment+whitespace chars up to first non-comment char' from '27.0; doc of `uncomment-region(-default)'' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 02 Jun 2018 14:22:01 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'minor' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 02 Jun 2018 14:22:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 31615 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 15 Mar 2025 12:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31615; Package emacs. (Sat, 15 Mar 2025 17:15:02 GMT) Full text and rfc822 format available.

Message #23 received at 31615 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Cc: "31615 <at> debbugs.gnu.org" <31615 <at> debbugs.gnu.org>
Subject: RE: bug#31615: 27.0; doc of `uncomment-region(-default)'
Date: Sat, 15 Mar 2025 17:13:57 +0000
Didn't receive the usual close message (?), so I tried to reply to the close "control" msg, which apparently doesn't work.

Here's my reply to the mysterious/~silent closing:
____

Huh? Please explain why this was closed. Was it done by mistake? Was the enhancement implemented ("fix")? 

If not, why was it closed? Eli explicitly left it open as an enhancement request, which is TRT.

Thx.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Apr 2025 11:24:26 GMT) Full text and rfc822 format available.

This bug report was last modified 27 days ago.

Previous Next


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