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

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

bug#64104: Subject: 30.0.50; uncomment-region-default-1


From: Eli Zaretskii
Subject: bug#64104: Subject: 30.0.50; uncomment-region-default-1
Date: Sat, 17 Jun 2023 11:38:24 +0300

> Date: Fri, 16 Jun 2023 10:51:24 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> C-u comment-dwim RET with an active region of the following Python code:
> 
> ---
> # for i in text:
> #     print("(i): {}".format(str(i)))
> ---
> 
> results in error saying
> 
> uncomment-region-default-1: Beginning of buffer

AFAICT, that's because invoking comment-dwim with C-u in this case
makes no sense: the comment delimiters have just 1 character in this
case.  Try "C-u 1 M-x comment-dwim" instead.

> comment-dwin says:
> 
> if a prefix ARG is specified, call ‘comment-kill’
> 
> which is my intended use-case.

If this is what you wanted, then you should invoke "C-u comment-dwin"
without having an active region.  The doc string says that if the
region is active, it will call comment-region or uncomment-region, and
will call comment-kill only "otherwise" (i.e. if there's no active
region).  I suggest to read the node "Comment Commands" in the Emacs
manual, it describes this in more detail.

I've now made the doc string slightly more detailed, especially wrt
how the prefix argument is used in the various use cases, but other
than that, I don't think there's a bug here.

Stefan, any comments?





reply via email to

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