unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31615: 27.0; doc of `uncomment-region(-default)'
@ 2018-05-28  4:20 Drew Adams
  2018-06-02 10:44 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2018-05-28  4:20 UTC (permalink / raw)
  To: 31615

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''





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

* bug#31615: 27.0; doc of `uncomment-region(-default)'
  2018-05-28  4:20 bug#31615: 27.0; doc of `uncomment-region(-default)' Drew Adams
@ 2018-06-02 10:44 ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-06-02 10:44 UTC (permalink / raw)
  To: Drew Adams; +Cc: 31615

> Date: Sun, 27 May 2018 21:20:04 -0700 (PDT)
> From: Drew Adams <drew.adams@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.





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

* bug#31615: 27.0; doc of `uncomment-region(-default)'
       [not found] ` <<83lgbxeac4.fsf@gnu.org>
@ 2018-06-02 13:47   ` Drew Adams
  2018-06-02 14:14     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2018-06-02 13:47 UTC (permalink / raw)
  To: Eli Zaretskii, Drew Adams; +Cc: 31615

> 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?





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

* bug#31615: 27.0; doc of `uncomment-region(-default)'
  2018-06-02 13:47   ` Drew Adams
@ 2018-06-02 14:14     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-06-02 14:14 UTC (permalink / raw)
  To: Drew Adams; +Cc: 31615

> Date: Sat, 2 Jun 2018 13:47:38 +0000 (UTC)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 31615@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.





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

end of thread, other threads:[~2018-06-02 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28  4:20 bug#31615: 27.0; doc of `uncomment-region(-default)' Drew Adams
2018-06-02 10:44 ` Eli Zaretskii
     [not found] <<f7e49ba0-f2bd-4da0-84bd-f6cda8167a0e@default>
     [not found] ` <<83lgbxeac4.fsf@gnu.org>
2018-06-02 13:47   ` Drew Adams
2018-06-02 14:14     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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