emacs-devel
[Top][All Lists]
Advanced

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

Re: Just a thought about comment-line


From: Stefan Monnier
Subject: Re: Just a thought about comment-line
Date: Sun, 31 May 2020 15:05:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> It automatically decides whether to comment or to uncomment, indeed.
> Precisely.  It's a compromise, and not a great one (IMO).  Better to
> have two commands, one for block commenting and the other for
> end-of-line commenting.

I have never seen someone comment a comment.  Do you have a use case for it?

> It's not just that it has to correctly guess what you mean.  It's also
> that _you_ have to guess what it's guessing you mean. ;-)

That in nature of DWIM commands, yes.

>> Right, as a general rule, the LF char belongs to the line that it
>> terminates, so a position at BOL is really "between lines".
>> Of course, that would require a special case when START=END=BOL.
>
> That special case is what `comment-region-lines' handles.

At the detriment of the other case.

> It just does this:
> (comment-region BOL EOL PREFIX-ARG).

But that's what the OP complained about when you do

    C-a C-SPC
    C-n C-n M-x comment-region-lines RET

where it ends up commenting 3 lines, even though there are only 2 lines
enclosed in the region.


        Stefan




reply via email to

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