GNU bug report logs - #45947
28.0.50; comment-dwim and undo in active region

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bodertz <bodertz@HIDDEN>; Keywords: confirmed; dated Mon, 18 Jan 2021 05:54:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 45947 <at> debbugs.gnu.org:


Received: (at 45947) by debbugs.gnu.org; 7 Jun 2022 14:14:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 07 10:14:58 2022
Received: from localhost ([127.0.0.1]:41049 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nyZz0-0002rp-FF
	for submit <at> debbugs.gnu.org; Tue, 07 Jun 2022 10:14:58 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54094)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nyZyy-0002rY-Hu
 for 45947 <at> debbugs.gnu.org; Tue, 07 Jun 2022 10:14:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Cmr2Dwh80j0yyrkc0C4ujZxNAwt//QVLtFvmKW1vfSE=; b=i5GQuxlQ6RfA7OEUNt+I4FqEkX
 gVr4YLr70shPp0Xs0eBZbSeFKPhnSH/QQDrvGsIt0QjgsUZpJg1I/ZrU1bF5W42PB46KhJfBFbM7H
 k4zg05nHpQMIgJJsiuxeSdbjny1bWx6ezNONNhRfpjDTcnsWVMLKQn3q+XG2yrPEx+gU=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nyZyq-0003dl-7Y; Tue, 07 Jun 2022 16:14:50 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Bodertz <bodertz@HIDDEN>
Subject: Re: bug#45947: 28.0.50; comment-dwim and undo in active region
References: <87wnwabxjw.fsf@HIDDEN>
X-Now-Playing: The Wake's _Harmony & Singles_: "Testament"
Date: Tue, 07 Jun 2022 16:14:47 +0200
In-Reply-To: <87wnwabxjw.fsf@HIDDEN> (bodertz@HIDDEN's message of "Sun, 
 17 Jan 2021 22:53:39 -0700")
Message-ID: <874k0wh86g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Bodertz <bodertz@HIDDEN> writes: > Undoing with an active
 region does not always work as expected if > `comment-dwim' is used. From
 emacs -Q: > > 1. Create a new buffer (C-x b new-buffer RET) > > 2. Insert
 A, B, and C on seperate lin [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 45947
Cc: 45947 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Bodertz <bodertz@HIDDEN> writes:

> Undoing with an active region does not always work as expected if
> `comment-dwim' is used.  From emacs -Q:
>
> 1. Create a new buffer (C-x b new-buffer RET)
>
> 2. Insert A, B, and C on seperate lines as below
>    ('*' represents point)
>
> A
> B
> C*
>
> 3. Create an active region over the last two lines (C-SPC C-p C-a)
> 4. Use comment-dwim (M-; ; RET)
> 5. Create an active region over the last two lines (C-SPC M->)
> 6. Undo (C-/):
>
> A
> ; *
> ; C

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I can reproduce this in Emacs 29, too.  I wonder whether it's related to
bug#21523 -- it, too, mis-computes the active region at the edges and
includes the wrong thing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45947; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Jan 2021 05:53:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 18 00:53:48 2021
Received: from localhost ([127.0.0.1]:46116 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l1NU4-0002wo-1X
	for submit <at> debbugs.gnu.org; Mon, 18 Jan 2021 00:53:48 -0500
Received: from lists.gnu.org ([209.51.188.17]:37688)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bodertz@HIDDEN>) id 1l1NU1-0002wg-QK
 for submit <at> debbugs.gnu.org; Mon, 18 Jan 2021 00:53:46 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53904)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bodertz@HIDDEN>) id 1l1NU1-0000ip-HO
 for bug-gnu-emacs@HIDDEN; Mon, 18 Jan 2021 00:53:45 -0500
Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:39442)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <bodertz@HIDDEN>) id 1l1NTz-0003Gm-Vy
 for bug-gnu-emacs@HIDDEN; Mon, 18 Jan 2021 00:53:45 -0500
Received: by mail-pj1-x1034.google.com with SMTP id u4so9031229pjn.4
 for <bug-gnu-emacs@HIDDEN>; Sun, 17 Jan 2021 21:53:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=quRKnfq2zlcgQe0wytNhEo6vyPFtPcNImhwWYrJCSzM=;
 b=FeKXGWTFK16R0GbPBfP8AJLnsCl/8H/QZv8QMEq8FNZQqBnNjgmMOW/2x/YKFzYXbo
 Ra01oVM7NDEkTkHiHN/GDMcCqTA2LWyqrsxTpn2rXy7Pt8AzarXRPLXpJyatoe6TTXF3
 LKstS59GxhSY3lUVSWUA+tEdCrYcDLBLTfXFjFel3xn8EcAPFbvaUgg5f9vxs3qEJsj7
 qB3NlM4lR5/UZMXJNCyAtU3vC4Lxm+YIzfsh8j/Q52IoPubU1gZePD6gmpzmgh1eZk30
 +vSuo/0KtDzLUMyWV2C40KG4z67MI3Gpk/crBqfuSDKol5t1fvY1TqakGD9klH5h9QVj
 0Tng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=quRKnfq2zlcgQe0wytNhEo6vyPFtPcNImhwWYrJCSzM=;
 b=gZL+tX0IEIuSWKQ0Iyn1nRW2g6+HB9wr96IZAwiMvCfn34BLXCEZ7N/rBXEtG9ZYPH
 +Z87QrsdRX3+az+kgopQwEB68IC6Pk47hkWY7tt7yD9d5LQ817+s8h+FYc0TxmWSxRbv
 z7ZeuMkHNCFhf/w1jc5ToClI0HSZ4CaHrItWVnZzrr20LGSxFDuqg3zCbNKA2Sh3/paz
 2UtFWO5cIfefGv6arcPtb9FpwSCe33nMGNZ3eYgF8gKsX9UAqC3Gy2gDIEagbtH7OA0N
 vkQhlW7JO5843uNYg/eejvHF6HQNylBEh5Nj8EjfFJGdpMLBpB3amMvUqzXA5rzsYNfM
 MpUA==
X-Gm-Message-State: AOAM533Gb5mDtuhjPrCfSUYiXsMoeVYrcOSloIjet49BdYzUxYES4pp4
 V0L/UFOb6A2AsouOZih6MocjM8O/xBc=
X-Google-Smtp-Source: ABdhPJx2Ie6JKHFru0t7dXPTP/vYQBayoepajC6rzedy14icW0XHKRImZm/dUUPqmXfsRB3nV+ytjw==
X-Received: by 2002:a17:902:bb95:b029:dc:e7b:fd6e with SMTP id
 m21-20020a170902bb95b02900dc0e7bfd6emr25026259pls.12.1610949221969; 
 Sun, 17 Jan 2021 21:53:41 -0800 (PST)
Received: from flavia (S01061cabc0a572b3.ed.shawcable.net. [68.148.90.108])
 by smtp.gmail.com with ESMTPSA id me3sm8721366pjb.32.2021.01.17.21.53.40
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 17 Jan 2021 21:53:41 -0800 (PST)
From: Bodertz <bodertz@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; comment-dwim and undo in active region
Date: Sun, 17 Jan 2021 22:53:39 -0700
Message-ID: <87wnwabxjw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::1034;
 envelope-from=bodertz@HIDDEN; helo=mail-pj1-x1034.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)



Undoing with an active region does not always work as expected if
`comment-dwim' is used.  From emacs -Q:

1. Create a new buffer (C-x b new-buffer RET)

2. Insert A, B, and C on seperate lines as below
   ('*' represents point)

A
B
C*

3. Create an active region over the last two lines (C-SPC C-p C-a)
4. Use comment-dwim (M-; ; RET)
5. Create an active region over the last two lines (C-SPC M->)
6. Undo (C-/):

A
; *
; C

7. Undo again (C-/):

A
;*
; C

8. Undo again (C-/):

A
*
; C

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
Windowing system distributor 'System Description: openSUSE Tumbleweed

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash
 SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash
 --prefix=/gnu/store/k327dvhl6d897r3jz7gyhdyf0rdvdarh-emacs-next-pgtk-28.0.50-0.d46a223
 --enable-fast-install --with-pgtk --with-xwidgets --with-modules
 --with-cairo --disable-build-details'




Acknowledgement sent to Bodertz <bodertz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#45947; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 7 Jun 2022 14:30:02 UTC

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