GNU bug report logs - #65734
29.1.50; kill-whole-line and visibility of Org subtrees

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: Sebastian Miele <iota@HIDDEN>; dated Mon, 4 Sep 2023 14:49:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 21:13:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 16:13:14 2024
Received: from localhost ([127.0.0.1]:37841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOOq1-0006lf-LN
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 16:13:13 -0500
Received: from mout01.posteo.de ([185.67.36.65]:43953)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rOOpx-0006lM-9P
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 16:13:12 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D849A240027
 for <65734 <at> debbugs.gnu.org>; Fri, 12 Jan 2024 22:13:04 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1705093984; bh=KoBeUqt8L8KkQllHAUNcyO2y+Wpn+idqhc1jKIhbyis=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=OrQT7vWx2he9ZDZ4yv3NfO/lckWPJ6QuHyvTi/mSNhJqP0ZFbmAv026/tlDs9BIRM
 xwiSSpLI+zBKyOIw2V629PeD+upQSSzkwBWvArfV/vo1rAqS21kW0e8GDYAFre8oVI
 lWDig6cOlfxFne7Yn1ZcNbEGvLfd6/mm0l/U4myqoYQoruWDotcQzcHqzeKJ0eHvcB
 J0mDq6wadIlY6qljWwdzCfCw4uhxPX7rcHwVkKi/JQ6m2BarnpaGdkOSjR4OiX1C+4
 inv0RkwFim107kvUqRUKh/o9RtA8hDu9DQ1xmolQCD4YFcCmrxF4MLaURjMaXwSm9v
 hN0NEtxVQp/2A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TBZ4v5nLrz9rxG;
 Fri, 12 Jan 2024 22:13:03 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwv5xzymf8f.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <jwv5xzymf8f.fsf-monnier+emacs@HIDDEN>
Date: Fri, 12 Jan 2024 21:16:12 +0000
Message-ID: <87mstantgj.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 manikulin@HIDDEN, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> (setq-local kill-line-query-function #'org-kill-line-query)
>
> Please use `add-function` for such things.
> That's its raison d'=C3=AAtre.

When comparing imaginary kill-line-query-functions (abnormal hook) +
add-hook vs. kill-line-query-function + add-function, which one will be
more preferred?

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 21:09:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 16:09:28 2024
Received: from localhost ([127.0.0.1]:37836 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOOmO-0006fu-0K
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 16:09:28 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rOOmK-0006ff-Ra
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 16:09:27 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 17C8D1000DA;
 Fri, 12 Jan 2024 16:09:20 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1705093759;
 bh=EaiJXbMayZ1T3MH5yDz7PdtLnhinQi0trtkioZuHd1E=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=EbnRm9AxT37j2XTjjeJEQ0a4JOe2hhoKQdu9yygHVWr3d4sxhzjFgY5XGEBiwazIq
 w9QBer7tE1oBAJwlBTGOadeklHmQjz/hzBmPn8reT9AE2PCZ8x+oV27TL8iyP/ueIG
 WpuMkoNShQfgenFjKPIO7HMKud4F8zk2ipInpqOAi2GmlKm69D8wI7u0IR0NKJHg6m
 N8fdfiXqL2XWqDpVXm17YF3qAhMoAdM528tOf5Anhr/qf6p8Qs66rXd8iTPhuMX0q3
 hcDmhfHKRkPWxUkkChK5tu5rVQsXU0t7uFjN1mhRYmhDzPTFRDCgDSP/UWOLmKsS+V
 OFZpn/ZnDqCiA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3183010007D;
 Fri, 12 Jan 2024 16:09:19 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EC14E120CAA;
 Fri, 12 Jan 2024 16:09:18 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87bk9rivzo.fsf@localhost> (Ihor Radchenko's message of "Thu, 11
 Jan 2024 18:08:11 +0000")
Message-ID: <jwv5xzymf8f.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <875y02y0da.fsf@localhost> <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
 <87frz6w2zt.fsf@localhost> <83cyu9nyea.fsf@HIDDEN>
 <87sf35pcds.fsf@localhost> <83y1cxmgws.fsf@HIDDEN>
 <87ttnjj2dp.fsf@localhost> <83bk9rlusw.fsf@HIDDEN>
 <87h6jjj17y.fsf@localhost> <838r4vlt0n.fsf@HIDDEN>
 <87bk9rivzo.fsf@localhost>
Date: Fri, 12 Jan 2024 16:09:18 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.204 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 manikulin@HIDDEN, iota@HIDDEN
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 (---)

> (setq-local kill-line-query-function #'org-kill-line-query)

Please use `add-function` for such things.
That's its raison d'=EAtre.


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 14:12:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 09:12:35 2024
Received: from localhost ([127.0.0.1]:35236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOIGx-0002yt-GQ
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 09:12:35 -0500
Received: from mout01.posteo.de ([185.67.36.65]:50447)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rOIGs-0002yV-MP
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 09:12:34 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 11AE6240028
 for <65734 <at> debbugs.gnu.org>; Fri, 12 Jan 2024 15:12:26 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1705068747; bh=XFGDz92xI4q6dens+CVapKw44dTeC7h+mB3O+4Bg13o=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=JdSv7mLylMfeyAC7RN/CFilsUTo482Bcvr9APfbp1rCRIGVmxks+j1w2ZMvgvgCCW
 UaS8KUAk2RhKnVDO4ZhbkX4mcPP8bxAkO64TYGthGcYyc13vJMi4Js5vfGN20nK24y
 kPct1bdO2zxNcauf8RLlQqt0pXAIWhbc0SfUTxArzFpnuIbRhhgduK3wWAI7LbQC0P
 eqm2o6jPvDsCAItW/y52RVOtpzZA+QPGD61dkwR5OrqJg2CW94Ed5K2X6b+bSjgAam
 a6XgLkemLLTEEUYbc5bqil0TLAMgh+i64CWfp3CyCY4BTOi2t11g+tbIvDjfZw7/2P
 p5W1uWFECYzkg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TBNlX6Ry5z9rxB;
 Fri, 12 Jan 2024 15:12:24 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83v87yir7m.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <8334v3lltf.fsf@HIDDEN> <87le8uhh9a.fsf@localhost>
 <83zfxaivfv.fsf@HIDDEN> <87v87ypvyh.fsf@localhost>
 <83v87yir7m.fsf@HIDDEN>
Date: Fri, 12 Jan 2024 14:15:37 +0000
Message-ID: <87frz2prhy.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> May you please elaborate what you mean by "old one"?
>
> kill-line-query-function

There is no such variable in Emacs. I proposed to introduce a new
variable `kill-line-query-function' earlier in this thread. There is no
backwards-compatibility problem we need to solve here.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 14:04:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 09:04:04 2024
Received: from localhost ([127.0.0.1]:35226 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOI8h-0002lB-TW
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 09:04:04 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:41920)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rOI8e-0002kY-I9
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 09:04:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rOI8Z-0006lA-Sh; Fri, 12 Jan 2024 09:03:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=2m1Et1jvfv6IEay8U8dwPNOaOafFIbEVXo8zRwPiYKk=; b=RTYjkghPuo7Z
 nbR3lfemzbO1Xg+sBeHD0eU/6UbIQsjze87uo8kQNOHQ/saU6HCM8IeQebaFo4xR74i/uHmMo1DLA
 ZhWpPXkIDTB/9ewQr7a+SXSOok9hEvCJQlMtKbbyjYZo5ZbUFlWTGkXf4xk/5fW77+Hcr2SWgKr17
 vTKIM/oq9y0jZvWkQMT8FwCSvdERjvRdl/yGbC0Ce13nao3VlBfD+/vLoIWkt9hgvhocjrR0wMkia
 tlm+cr4vUig50q4NjXQES3nojP4se7IAmPlGfecg1+cuodDp6lHZGiXZomB27VPUUejxOZQqNA3SN
 L0LlUeCtbhdWIWV/cPhIvg==;
Date: Fri, 12 Jan 2024 16:03:41 +0200
Message-Id: <83v87yir7m.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87v87ypvyh.fsf@localhost> (message from Ihor Radchenko on Fri,
 12 Jan 2024 12:39:18 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <8334v3lltf.fsf@HIDDEN> <87le8uhh9a.fsf@localhost>
 <83zfxaivfv.fsf@HIDDEN> <87v87ypvyh.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Fri, 12 Jan 2024 12:39:18 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> I think that I see what you mean. What we can do to achieve this is
> >> changing `kill-line-query-function' into abnormal hook
> >> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
> >> use (run-hook-with-args-until-success 'kill-line-query-functions) to
> >> decide whether to show a query.
> >> 
> >> Does it make sense?
> >
> > It might, yes.  But do we have to _replace_ the hook? cannot we have
> > both?  I.e. if the new one is defined, call it, otherwise call the old
> > one.  That would be more backward-compatible, I think.
> 
> May you please elaborate what you mean by "old one"?

kill-line-query-function




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 12:36:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 07:36:17 2024
Received: from localhost ([127.0.0.1]:35106 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOGlk-00012D-UN
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:36:17 -0500
Received: from mout01.posteo.de ([185.67.36.65]:53703)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rOGlf-00011k-KD
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:36:14 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 09409240029
 for <65734 <at> debbugs.gnu.org>; Fri, 12 Jan 2024 13:36:08 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1705062968; bh=T0CcII6YbCnVR71zAxJGZWlINoPab67zux3bz9RU4dI=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=WqMJJBORM7QeQ9fV/9bXFsNvaRgYasUSKQOJkHpVJQBLvw+qsBfHTUaTUmDrc7vtC
 5S/jVtuUToAyANuJj+RnLhcv9mehudIr8fVndD9glmrFQBnY4XEpAJJCEJuT5tqDU6
 p+6ACtvnqGTbTpsez5cAPvJg4fHgl/FpkXlVsXmKiHoF0a0PXAo9Bw+NXcw3NuvuYL
 LYbh2UicG0ASgS6ttmre/ACpb2qxxTOtegmC09HMTwjm2/Gdu9T6I/1NqNLyy2dPhd
 VM7+LiO4ninEbc4J46wl36XMqFpSStFtwPeN5nYO0mJg/xdeTUD54GyO89LTPw433w
 Q/D9QZdEi1+Rw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TBLcQ1yHSz9rxD;
 Fri, 12 Jan 2024 13:36:05 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83zfxaivfv.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <8334v3lltf.fsf@HIDDEN> <87le8uhh9a.fsf@localhost>
 <83zfxaivfv.fsf@HIDDEN>
Date: Fri, 12 Jan 2024 12:39:18 +0000
Message-ID: <87v87ypvyh.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> I think that I see what you mean. What we can do to achieve this is
>> changing `kill-line-query-function' into abnormal hook
>> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
>> use (run-hook-with-args-until-success 'kill-line-query-functions) to
>> decide whether to show a query.
>> 
>> Does it make sense?
>
> It might, yes.  But do we have to _replace_ the hook? cannot we have
> both?  I.e. if the new one is defined, call it, otherwise call the old
> one.  That would be more backward-compatible, I think.

May you please elaborate what you mean by "old one"?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 12:32:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 07:32:40 2024
Received: from localhost ([127.0.0.1]:35098 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOGiF-0000wf-Tj
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:32:40 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58598)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rOGiD-0000wR-9c
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:32:38 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rOGi8-0002op-LX; Fri, 12 Jan 2024 07:32:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=cuB2vXyaGZ+X28AmeToJKwSMdH0WRpdNWcCzLuzWXRg=; b=T/TGS4AIGWvg
 XitZmHveD59S9/ZCfhDlTkLLEqp+6h6fnrGOEfpqas6gsEAo8Nm66RVJJcH2nM3L0nArH8BRjsp25
 XNHxguP9oznKQMbtlszZ00AKhyY2+nF6m6H4Nda8k3gjAtaXXslIB/Ox0fDfs2pbOQpdC7sD8kD3r
 HopZjQo/hWcSqV8IbLh4F/g6ecn9/BQlbDB7djM1F1lLHvdZ5Md0CgL1TBvhPU4dSqdFimFmprmd5
 /sMwfCHdC0lWiGEjpejZZgpc4ZPlyUjPfqzJLn9Wn3uVirfKMwjkqjFFEbGaKJrx69EO0KIDt6oGd
 fDBtwdSc9oqAj+X+A54qVw==;
Date: Fri, 12 Jan 2024 14:32:20 +0200
Message-Id: <83zfxaivfv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87le8uhh9a.fsf@localhost> (message from Ihor Radchenko on Fri,
 12 Jan 2024 12:24:01 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <8334v3lltf.fsf@HIDDEN> <87le8uhh9a.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Fri, 12 Jan 2024 12:24:01 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Then, Org mode can instead have
> >> 
> >> (setq-local kill-line-query-function #'org-kill-line-query)
> >> (defun org-kill-line-query (beg end)
> >>   (org-with-point-at beg
> >>     (when (and (org-at-heading-p)
> >>                (progn
> >>                  (end-of-line)
> >>                  (and (< (point) end)
> >>                       (org-fold-folded-p))))
> >>        "Kill hidden subtree along with headline? ")))
> >
> > I don't know what org-with-point-at and org-fold-folded-p do, but my
> > point is that you should consider the case when kill-line kills
> > invisible text that has nothing to do with Org's headings and trees,
> > so I suggest to either make the detection code smarter (so it could
> > distinguish between the two), or make the prompt text vaguer (to not
> > claim that the text must be a subtree).
> >
> > And if that is still not clear or you disagree, let's leave it at
> > that.
> 
> I think that I see what you mean. What we can do to achieve this is
> changing `kill-line-query-function' into abnormal hook
> `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
> use (run-hook-with-args-until-success 'kill-line-query-functions) to
> decide whether to show a query.
> 
> Does it make sense?

It might, yes.  But do we have to _replace_ the hook? cannot we have
both?  I.e. if the new one is defined, call it, otherwise call the old
one.  That would be more backward-compatible, I think.




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Jan 2024 12:20:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 07:20:58 2024
Received: from localhost ([127.0.0.1]:35085 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOGWw-0006QZ-7y
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:20:58 -0500
Received: from mout02.posteo.de ([185.67.36.66]:57419)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rOGWs-0006QJ-C5
 for 65734 <at> debbugs.gnu.org; Fri, 12 Jan 2024 07:20:56 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 6F48C240101
 for <65734 <at> debbugs.gnu.org>; Fri, 12 Jan 2024 13:20:50 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1705062050; bh=mnnzPaC0lQ1vV5ME0VeuX8LE+U3Ccw9z+SG6Ipuv9BY=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=nvtoOVUB/S1wUYfqm53Sqf2zuDF+2hkH2ZQHNSZtdnU8fgUuWL1SeXQRFT/Cqru14
 3FiGvwEh2Uq0/UAtedhR5ZSrbU5lRcVvZmm9jvI8ZjLbIjHd71TgoonpnLoYXCc0VC
 WyTFO5SDtLhSetPRoyu9hWXMrjWF4gU4df3hqkzhnz/B+yUslGlrUNi2Ry3wZvC9Oo
 fCJxlZzyWFPEpOJHq7OUlB/LdPNOLaTOCqco4SSC13MvH5UurY1KE4mGIrJ/tqD8oh
 8S95JHPu3KGmHKMiMoxH98OhZGEtgY0GURCgVtGPJHZ0QFI3syooJ5f5hJkuC3XG33
 cV8hPKPQs5nvg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TBLGm6BYDz6tyZ;
 Fri, 12 Jan 2024 13:20:48 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <8334v3lltf.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
 <8334v3lltf.fsf@HIDDEN>
Date: Fri, 12 Jan 2024 12:24:01 +0000
Message-ID: <87le8uhh9a.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Then, Org mode can instead have
>> 
>> (setq-local kill-line-query-function #'org-kill-line-query)
>> (defun org-kill-line-query (beg end)
>>   (org-with-point-at beg
>>     (when (and (org-at-heading-p)
>>                (progn
>>                  (end-of-line)
>>                  (and (< (point) end)
>>                       (org-fold-folded-p))))
>>        "Kill hidden subtree along with headline? ")))
>
> I don't know what org-with-point-at and org-fold-folded-p do, but my
> point is that you should consider the case when kill-line kills
> invisible text that has nothing to do with Org's headings and trees,
> so I suggest to either make the detection code smarter (so it could
> distinguish between the two), or make the prompt text vaguer (to not
> claim that the text must be a subtree).
>
> And if that is still not clear or you disagree, let's leave it at
> that.

I think that I see what you mean. What we can do to achieve this is
changing `kill-line-query-function' into abnormal hook
`kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will
use (run-hook-with-args-until-success 'kill-line-query-functions) to
decide whether to show a query.

Does it make sense?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 19:20:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 14:20:02 2024
Received: from localhost ([127.0.0.1]:33914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rO0av-00047d-Uh
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 14:20:02 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rO0au-00047E-Es
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 14:20:01 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rO0ap-0001Wx-3g; Thu, 11 Jan 2024 14:19:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ykOq30SasERhAx5mA/1xzF9FWoNe62/hA3aadlJCy2g=; b=IKpq7hix/3+u
 Ht09gO5zwasjkza2XQgdZzL68H2J81zu7YgXJSDJrYNj3KBzdleLOgErJKKu5mUtMBiunNShZ3Rww
 n0se3kW9cMIgHHHG4fYPIWjvxcEbzOjP5xZ87FAHiPD4bO+F8sIGzN83PBL1Nb1hQC4mVcQh/p+Uv
 dA/+y49BPoQiyEslFlRatzJaqmlo2iExRgurD4NRbZqTK0JgypZUTm6BkDnK08eI8XwtXgxqEUJE/
 x/aZg+mpegrV9M68MO4bxD9aWISe8dplbQovRae/WCYyySOg/9utc8S4ocwzUdvM2t35zZBB33PJQ
 elP56tBl6YwpfxVtWs2+9g==;
Date: Thu, 11 Jan 2024 21:19:40 +0200
Message-Id: <8334v3lltf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87bk9rivzo.fsf@localhost> (message from Ihor Radchenko on Thu,
 11 Jan 2024 18:08:11 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN> <87bk9rivzo.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Thu, 11 Jan 2024 18:08:11 +0000
> 
> Then, Org mode can instead have
> 
> (setq-local kill-line-query-function #'org-kill-line-query)
> (defun org-kill-line-query (beg end)
>   (org-with-point-at beg
>     (when (and (org-at-heading-p)
>                (progn
>                  (end-of-line)
>                  (and (< (point) end)
>                       (org-fold-folded-p))))
>        "Kill hidden subtree along with headline? ")))

I don't know what org-with-point-at and org-fold-folded-p do, but my
point is that you should consider the case when kill-line kills
invisible text that has nothing to do with Org's headings and trees,
so I suggest to either make the detection code smarter (so it could
distinguish between the two), or make the prompt text vaguer (to not
claim that the text must be a subtree).

And if that is still not clear or you disagree, let's leave it at
that.




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 18:05:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 13:05:11 2024
Received: from localhost ([127.0.0.1]:33845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNzQU-0005ag-Qm
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 13:05:11 -0500
Received: from mout01.posteo.de ([185.67.36.65]:42941)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNzQR-0005a8-43
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 13:05:08 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id A2ED2240027
 for <65734 <at> debbugs.gnu.org>; Thu, 11 Jan 2024 19:05:03 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704996303; bh=lTse73jpxmOQOLqRc3wxjXnVtlcEXBtKhqALK1wuoKQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=jwKBGvqCti3ygM+MsxXOKBy5pnC5UafrQOvS7daIWU3Wbt5C3q+kUu8N4fZUxMlrv
 g13hSukRHz1w84vaaCmy7yGCn27QhH/Wo5ZSArNE7HSRPJJfmVkR6A/o1rZk0pTjNP
 bjqma5lbYrqIt1f9lZ0Jozm4vPutRMwlFxaasK0PmtoZMz2TvAEorEwoOEBwGFiFfd
 PUUDcFvRWgjeXgtvELzzCJZX79pY8z09Ud14M/Yj8GoXgxfKj4g/Z6TBcKFZJgpIJK
 d5RdnK4cbbDh7i4Dl0pRWydkuXpwmjFFXx8Wj1XheXtzYz92/yv2iMCwsBbBpLO3Ws
 nx0ZNCN5bSqJw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T9syQ3F2jz6tvw;
 Thu, 11 Jan 2024 19:05:02 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <838r4vlt0n.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
 <838r4vlt0n.fsf@HIDDEN>
Date: Thu, 11 Jan 2024 18:08:11 +0000
Message-ID: <87bk9rivzo.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> > How would kill-line know that it's about to kill a subtree?  All it
>> > knows is that it is killing some invisible text.
>> 
>> I imagine the following:
>> 
>> 1. `kill-*-line' function will, by default, test if invisible text of
>>    length size is killed and query the user when called interactively.
>> 
>> 2. Major modes could also set buffer-local `kill-line-query-function'
>>    that will return nil when killing should proceed without query or a
>>    string with query text.
>
> If the command is only sensitive to invisible text, it could warn
> about so-and-so many invisible characters being killed, but it could
> not warn about "subtrees", which is what you wanted.  Invisible text
> in a buffer could have nothing to do with subtrees, even if the buffer
> is under org-mode.

Let me elaborate. In Elisp, I am thinking about something like:

(defvar-local kill-line-query-function #'kill-line-query-default)
(defun kill-line-query-default (beg end)
  (let ((nlines <count invisible lines between beg end>))
  (when (> nlines threshold)
    (format "Kill %d invisible lines? " nlines))))

Then, Org mode can instead have

(setq-local kill-line-query-function #'org-kill-line-query)
(defun org-kill-line-query (beg end)
  (org-with-point-at beg
    (when (and (org-at-heading-p)
               (progn
                 (end-of-line)
                 (and (< (point) end)
                      (org-fold-folded-p))))
       "Kill hidden subtree along with headline? ")))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 16:44:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 11:44:49 2024
Received: from localhost ([127.0.0.1]:33706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNyAi-0003wy-QL
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:44:49 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:51138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNyAc-0003wg-H6
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:44:47 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNyAX-0002Rn-AR; Thu, 11 Jan 2024 11:44:38 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=DcbTcDZxTaZi7cKNxiZYO5Yl4+e6D+u211Y4dRNFhcg=; b=lwhJUrCAq9Ka
 qSKo6GQAonygDsbDWrjf1vXmZ4PGOm9ylxy2WuVNLlHxeIp+xYBrFkyf1YsKlobnKCn8TYNDjy2GG
 MYlr85vh+n+sbGzn7KYX54hF+cY5KUhpCloQ5AWQ/wmCCjd/hbNyh6tvivni57+qsySIiiPSaQaZf
 q+DaYwXbaRiLgF1iUb3vvUUW4G5lz70WTAPZbL1YEiHeb6EK/eViOpfDOlyqLkImQmn7gCoHWv5nH
 sFpy9/Fz0gC+07e9CdgQtmSCiPYOu6HQcIpH4Tt7dn9MmgJc9+2xeQ8nPbVloc89uMizFkEbQAcif
 7JuebpceLUEFcD9yK68aYw==;
Date: Thu, 11 Jan 2024 18:44:08 +0200
Message-Id: <838r4vlt0n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87h6jjj17y.fsf@localhost> (message from Ihor Radchenko on Thu,
 11 Jan 2024 16:15:13 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN> <87h6jjj17y.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Thu, 11 Jan 2024 16:15:13 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> So, I'd like some way to configure `kill-whole-line'/`kill-line' to warn
> >> user about killing hidden text when we detect that we are deleting a
> >> folded heading. Something like:
> >> 
> >>    (y-or-n-p "Kill hidden subtree along with headline? ")
> >> 
> >> I believe that it might be useful in other situations as well. Like in
> >> outline-mode or outline-minor-mode.
> >
> > How would kill-line know that it's about to kill a subtree?  All it
> > knows is that it is killing some invisible text.
> 
> I imagine the following:
> 
> 1. `kill-*-line' function will, by default, test if invisible text of
>    length size is killed and query the user when called interactively.
> 
> 2. Major modes could also set buffer-local `kill-line-query-function'
>    that will return nil when killing should proceed without query or a
>    string with query text.

If the command is only sensitive to invisible text, it could warn
about so-and-so many invisible characters being killed, but it could
not warn about "subtrees", which is what you wanted.  Invisible text
in a buffer could have nothing to do with subtrees, even if the buffer
is under org-mode.




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 16:12:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 11:12:11 2024
Received: from localhost ([127.0.0.1]:33682 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNxf9-0006FY-Cj
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:12:11 -0500
Received: from mout02.posteo.de ([185.67.36.66]:52785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNxf4-0006F1-Bd
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:12:10 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 48B1D240101
 for <65734 <at> debbugs.gnu.org>; Thu, 11 Jan 2024 17:12:03 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704989523; bh=0ZyOfxU8m6+xlu4O3FOSglAbXlo4n/+WAfn2V3URTRE=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=Fcaas7PAAJ7Vl1f2LSRebVirU8dSah2fsfhud7ic2IULo4QmSitIAcCaXtz2YxSJ0
 /HunrszHShE/iYItwf5X3JMbzMjL5hwvCd6F0bmYnAv0PAgMNrIeXU78SI8S4gf6iH
 CR0xKTFz5JIqSlzfJPYC//zwKHTO0AmTUogYZgaLnsH1UHHy2gsc+bCCjPYwuL7rVL
 wnZbs+RUenmLGowaFSTUWFUmhhj7SEHLvf494VXJpjjs/dhNcCFD1cNmQ76EJl6GBn
 emZKN1DKcS7qWvemEsa4ThbNdqeONgZBQAZ0SEk2yJNT6biNuHQleOVEvClNVJRHfE
 iQ2/maijewEfg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T9qS16mvHz6ty3;
 Thu, 11 Jan 2024 17:12:01 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83bk9rlusw.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
 <83bk9rlusw.fsf@HIDDEN>
Date: Thu, 11 Jan 2024 16:15:13 +0000
Message-ID: <87h6jjj17y.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> So, I'd like some way to configure `kill-whole-line'/`kill-line' to warn
>> user about killing hidden text when we detect that we are deleting a
>> folded heading. Something like:
>> 
>>    (y-or-n-p "Kill hidden subtree along with headline? ")
>> 
>> I believe that it might be useful in other situations as well. Like in
>> outline-mode or outline-minor-mode.
>
> How would kill-line know that it's about to kill a subtree?  All it
> knows is that it is killing some invisible text.

I imagine the following:

1. `kill-*-line' function will, by default, test if invisible text of
   length size is killed and query the user when called interactively.

2. Major modes could also set buffer-local `kill-line-query-function'
   that will return nil when killing should proceed without query or a
   string with query text.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 16:06:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 11:06:08 2024
Received: from localhost ([127.0.0.1]:33677 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNxZI-00062X-6B
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:06:08 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:34146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNxZD-00061v-Ey
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 11:06:06 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNxZ8-00018v-6H; Thu, 11 Jan 2024 11:05:58 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=tDCvIbEMAaurn7TGE5h20VDAqlQ+jYs+KynDGVCpf7o=; b=LnsNXbcJrXMM
 HHBbjx5x7Vf4R992Iht2UQ4yRST4nIeY0fl5yvJarl9W+cZlKcIBg5vlaaxg87wlBImlpqzvrvElM
 76kWhNieaM9dgdOZ4MSnnflDyrOloxph2d8sGsC6zn4tgIMnFwQOBRCP+pjaeuL2FPAKadrgJmlBm
 BT63ScC3LNtgt4QuBH9OQCAHnS77Xn5Z0mHymh7b1iIYTMbdcKLW3ayQlB+CsALIwUF24T9KrTKmX
 x5GiphNLX0NK1nunk1cM1w/qWcR9Seh8JP4sD34dBa7qHehNIMnOqdwfABJ3NmhOprrEYUjsObVDS
 b4oBNdYtkC2GPQ2N6RbiSg==;
Date: Thu, 11 Jan 2024 18:05:35 +0200
Message-Id: <83bk9rlusw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87ttnjj2dp.fsf@localhost> (message from Ihor Radchenko on Thu,
 11 Jan 2024 15:50:10 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN> <87ttnjj2dp.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Thu, 11 Jan 2024 15:50:10 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Then, we discussed that Emacs commands to not always provide enough
> >> toggles. So, I am asking to add one in this thread.
> >
> > I don't think I understand what kind of toggle are we talking about.
> 
> What I would like to request is a way to handle the following situation:
> 
> * Heading<... few hundreds of lines of invisible text>
> 
> If the user calls `kill-whole-line', a large part of the buffer will get
> deleted. We had complains from the users about accidentally deleting a
> lot of text in Org files in such situations.
> 
> So, I'd like some way to configure `kill-whole-line'/`kill-line' to warn
> user about killing hidden text when we detect that we are deleting a
> folded heading. Something like:
> 
>    (y-or-n-p "Kill hidden subtree along with headline? ")
> 
> I believe that it might be useful in other situations as well. Like in
> outline-mode or outline-minor-mode.

How would kill-line know that it's about to kill a subtree?  All it
knows is that it is killing some invisible text.




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 15:47:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 10:47:09 2024
Received: from localhost ([127.0.0.1]:33652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNxGu-0002dq-Mv
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 10:47:09 -0500
Received: from mout01.posteo.de ([185.67.36.65]:47535)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNxGp-0002dF-Ee
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 10:47:07 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id CFC38240029
 for <65734 <at> debbugs.gnu.org>; Thu, 11 Jan 2024 16:46:59 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704988019; bh=Da18y0jBxJrQFJCP0u874DTKFK48AiwG6tFUd2tHo8Y=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=Ad1RPUovjDL428+1Q/sjSj/VULV/sWuVbaOfJFhr+a4+fyY8r4bC99+sebHlxAQi7
 8v/ItV028U9HFR+ZncwU6IVNWP9XIS3/kE/mN1HccveZb4RaeBRTV6Y5C9bPd17Pyc
 ZWl+ZXcO97B/iWQJ6Oeg0aDm2+TkVUde0AcDI89KReiolLOmmrhjVFO/8W1uy/+nbS
 jeuQ/31XRAV7ZBhZZ64Mc4ystSBiZVenIwJNxSvWWLxpZheyXV0btJ6TeDw1TpcG+2
 11SdS7vNH0HMChp6fvs/QU8WXQE5Yc2mL736uPrKD17t49NXskMbIP5S9ltsKeIMvn
 lYZPdZiOaYuLw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T9pv66k2cz9rxF;
 Thu, 11 Jan 2024 16:46:58 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83y1cxmgws.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <83y1cxmgws.fsf@HIDDEN>
Date: Thu, 11 Jan 2024 15:50:10 +0000
Message-ID: <87ttnjj2dp.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Then, we discussed that Emacs commands to not always provide enough
>> toggles. So, I am asking to add one in this thread.
>
> I don't think I understand what kind of toggle are we talking about.

What I would like to request is a way to handle the following situation:

* Heading<... few hundreds of lines of invisible text>

If the user calls `kill-whole-line', a large part of the buffer will get
deleted. We had complains from the users about accidentally deleting a
lot of text in Org files in such situations.

So, I'd like some way to configure `kill-whole-line'/`kill-line' to warn
user about killing hidden text when we detect that we are deleting a
folded heading. Something like:

   (y-or-n-p "Kill hidden subtree along with headline? ")

I believe that it might be useful in other situations as well. Like in
outline-mode or outline-minor-mode.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 15:41:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 11 10:41:26 2024
Received: from localhost ([127.0.0.1]:33640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNxBN-0008FR-MJ
	for submit <at> debbugs.gnu.org; Thu, 11 Jan 2024 10:41:25 -0500
Received: from mout02.posteo.de ([185.67.36.66]:43271)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNxBK-0008F7-C0
 for 65734 <at> debbugs.gnu.org; Thu, 11 Jan 2024 10:41:23 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 4DC7D240103
 for <65734 <at> debbugs.gnu.org>; Thu, 11 Jan 2024 16:41:19 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704987679; bh=JqgIoFx+kgDSyPR0xevPd4K7yAZAwlBrvTn7xgbyRXM=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=AvNwaaHfJegCNRlMKXORt7+yrs8FfEGoI7gT3Nf45ZCm04bzb/RCqUhVjkuUGxKaG
 x0+6KWj7hKDAYUBUiYk2SFw0m3286ciJmrq4/f+l31mubUkMlPrv7kPzdNYy38kcZl
 hV7a2RBvz9sLBsFgZjd4hb89DTGNzllePyyPTQM1qbFQH0GNUQ7EuAs7WbEdu++30W
 FB8+kF3knMZtY4lQWWtXlBJZqatYzDoiaQII0H+Lnjddty9Pzr5HI8APdoF1hVhitv
 HTku5nZE279pLxkxmfAab/z436zFWu8SXAIDd+B49rEUVGhyvyKhjKd3uEG4EON6II
 Jom9VsxbxzihA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T9pmZ42D3z6txQ;
 Thu, 11 Jan 2024 16:41:17 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwv1qap88jp.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
 <jwv1qap88jp.fsf-monnier+emacs@HIDDEN>
Date: Thu, 11 Jan 2024 15:44:29 +0000
Message-ID: <87wmsfj2n6.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 manikulin@HIDDEN, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>>> I said that remapping widely-used keys to commands that behave
>>> significantly differently places a non-trivial burden on users,
>>> especially on those who use the remapping mode relatively rarely.
>>
>> Sure. From which I concluded that Org mode should avoid remapping
>
> I don't think that's what it means.  It means that it depends on what is
> the end-user-visible effect.  If the remapped version of the command
> "does the same" conceptually, then it's OK (even more so if the
> non-remapped version of the command ends up misbehaving).

Ok. I stand corrected.

> I think the main question is: can we expect that some users out there
> will want to use the non-remapped version of the command because they
> prefer its behavior?

We received no bug reports complaining about non-standard behaviour of
remapped functions AFAIK. So, I do not think that Org mode has problems
here.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 16:40:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 11:40:21 2024
Received: from localhost ([127.0.0.1]:42639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNbcq-0004Fb-OA
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 11:40:21 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35282)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNbco-0004FL-0D
 for 65734 <at> debbugs.gnu.org; Wed, 10 Jan 2024 11:40:18 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNbcj-0007u2-Ce; Wed, 10 Jan 2024 11:40:13 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=t0+YVmcICd+6DmTQPLJcWVGUG1uGbaKjyDJAbyEbNSM=; b=YtYHfSv5gDTY
 6/DrGfr50dxGAVisZhKYFwiUSId7AQGtk37zdGLdI+KyCN6S2lG1hppmKoAgNzv4QQyPo7xeieHce
 vmukzpxBpegelQNa4mVbsYTCyUjQhnA+r84l0M9v4S2ZxUEY8OCaHEv5rAgFJiLJcBthlWQs7t/Ki
 p6kRY5ShRj/29RDCJLihAdlUh9px7+0XaPttr6vand8TMQjz5Y0WvQ2IdJA2hRSoVS/oKCX5TGUtU
 GNu72dwn8jMEwISp0HJOWPnRzd8gK0QlhRyNZvaeMTnyoBwT7dkBoCdjUMC5521Bpr0PBHYTdWUen
 8+k/2V/Ry9CzcHMoW2ZTZg==;
Date: Wed, 10 Jan 2024 18:39:50 +0200
Message-Id: <83o7dtm9bd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwv1qap88jp.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Wed, 10 Jan 2024 11:26:08 -0500)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <875y02y0da.fsf@localhost> <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
 <87frz6w2zt.fsf@localhost> <83cyu9nyea.fsf@HIDDEN>
 <87sf35pcds.fsf@localhost> <jwv1qap88jp.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, yantar92@HIDDEN, emacs-orgmode@HIDDEN,
 manikulin@HIDDEN, iota@HIDDEN
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 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  emacs-orgmode@HIDDEN,
>   65734 <at> debbugs.gnu.org,  manikulin@HIDDEN,  iota@HIDDEN
> Date: Wed, 10 Jan 2024 11:26:08 -0500
> 
> >> I said that remapping widely-used keys to commands that behave
> >> significantly differently places a non-trivial burden on users,
> >> especially on those who use the remapping mode relatively rarely.
> >
> > Sure. From which I concluded that Org mode should avoid remapping
> 
> I don't think that's what it means.  It means that it depends on what is
> the end-user-visible effect.  If the remapped version of the command
> "does the same" conceptually, then it's OK (even more so if the
> non-remapped version of the command ends up misbehaving).

Yes.




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 16:27:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 11:27:10 2024
Received: from localhost ([127.0.0.1]:42578 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNbQ5-0001FH-VZ
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 11:27:10 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41432)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rNbQ4-0001F6-Dt
 for 65734 <at> debbugs.gnu.org; Wed, 10 Jan 2024 11:27:08 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ED910442D9A;
 Wed, 10 Jan 2024 11:27:03 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704904022;
 bh=6heG3ougxHMqUIFd5Ld1bWx3tgm15VNaFTjPFA7RKFU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Olc8a6P/fwr5fjirrewDbXMuLmNvk3f1C8u927Ufm05hpcPxPt9pGqDAYFH6y5yPc
 Fuh/6zwgsv/j16uTDJLDmQ4D0zRg5dlNXlA9h1dl0/r6BByXDCksskuf1GFsgTHxBQ
 Cc47FFFW5xiKM2mHRvPe0M0pu250cIuH5oBoZ4LCJsy7ICqHBjbhcZAlhXBhmiEPMM
 JlvzV0R10Pt8pIvephR0GY/WFlVMXaYV4byswsMjZR4tn7xRgri5aFEFWaM3lVaOx7
 S+PYb2w6TMFQ95Zyw4ReN73lnmSmvSjIVYvpf3XyTavBWnAJLzxTrbD4YhkmH/Uq0h
 fOi8OMXRBwvCw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7D616442D97;
 Wed, 10 Jan 2024 11:27:02 -0500 (EST)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 69C281207A7;
 Wed, 10 Jan 2024 11:27:02 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87sf35pcds.fsf@localhost> (Ihor Radchenko's message of "Wed, 10
 Jan 2024 13:05:19 +0000")
Message-ID: <jwv1qap88jp.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <875y02y0da.fsf@localhost> <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
 <87frz6w2zt.fsf@localhost> <83cyu9nyea.fsf@HIDDEN>
 <87sf35pcds.fsf@localhost>
Date: Wed, 10 Jan 2024 11:26:08 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.137 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 manikulin@HIDDEN, iota@HIDDEN
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 (---)

>> I said that remapping widely-used keys to commands that behave
>> significantly differently places a non-trivial burden on users,
>> especially on those who use the remapping mode relatively rarely.
>
> Sure. From which I concluded that Org mode should avoid remapping

I don't think that's what it means.  It means that it depends on what is
the end-user-visible effect.  If the remapped version of the command
"does the same" conceptually, then it's OK (even more so if the
non-remapped version of the command ends up misbehaving).

I think the main question is: can we expect that some users out there
will want to use the non-remapped version of the command because they
prefer its behavior?

So, when the alternative is to directly modify the behavior of the
non-remapped command, remapping is always acceptable.
[ But sometimes, remapping just doesn't do what we want, because the
  command is also used as a function from other places.  ]


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 14:18:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 09:18:30 2024
Received: from localhost ([127.0.0.1]:39391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNZPa-0000sv-FF
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 09:18:30 -0500
Received: from mout02.posteo.de ([185.67.36.66]:47355)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNZPY-0000si-K0
 for 65734 <at> debbugs.gnu.org; Wed, 10 Jan 2024 09:18:29 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D3FEF240105
 for <65734 <at> debbugs.gnu.org>; Wed, 10 Jan 2024 14:02:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704891729; bh=SHN1UZQC9P6BJazx29fbd7I0CzZwJM9h9y4cjq+QXM8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=Bwrvppq/Qfmvxxx2FIj05KiTUjJoEOer7ZIUPC7ngOzzuV0YLNGQg03vfMlpQTC3t
 zgSf7+zMQlkArmuz0Xzom3AUZ3ajzYEcWFmf4XSKFnhCwO/aUGbQBubYsfenwCpDLJ
 5nhzQpSvzfS9zUZUdMUZhRVhUBkWxucPK3p3+1t1JzmvEtqBchTGA+BxMGSK37O+hh
 Sul4JnqQjepae4n+grrep9fpc1M9dI3Gh8ERI5NBcJVUel3qFCPW2nE85eAO0ugiHK
 BPmil4Z0nYbCNsMUrLIZQvhMVXf6WuUyZ7znUdplyBIfkmmixxZQSgqF7r8845lz6e
 Tf+AN8N+6FZaA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T97HM6kcLz6twp;
 Wed, 10 Jan 2024 14:02:07 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83cyu9nyea.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN>
Date: Wed, 10 Jan 2024 13:05:19 +0000
Message-ID: <87sf35pcds.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Eli told me in the past that Org mode should not remap keys.
>> See the discussion branch starting at
>> https://yhetil.org/emacs-devel/8735gfs3is.fsf@localhost/
>
> I said that remapping widely-used keys to commands that behave
> significantly differently places a non-trivial burden on users,
> especially on those who use the remapping mode relatively rarely.

Sure. From which I concluded that Org mode should avoid remapping and
instead prefer other means to adjust the behaviour of standard Emacs
commands.

Then, we discussed that Emacs commands to not always provide enough
toggles. So, I am asking to add one in this thread.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 13:56:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 08:56:15 2024
Received: from localhost ([127.0.0.1]:39304 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNZ43-0003N8-4B
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:56:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:36192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNZ3z-0003Ma-B9
 for 65734 <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:56:12 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNZ3u-00085v-NW; Wed, 10 Jan 2024 08:56:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=CQc8+3lY0hDrIBYaxB015HAAxRvN683L9ig0hR1W/QA=; b=oNcX/uB2L1B5
 dBxjAisczuLFbfgg20M+9RH64H8RzfXk94oEAKtLkbhFYjhAX6y35jSotwmIutJRR2tK5wJWLXFLi
 XgDtC+8JRHs95lhHEh0S2OqkpiMReCCOrk63Z0VE2efSQW3tfC4fn+/juzX1281vJLjdPeq1BhymU
 WuKyvKNvGJcjV1JmsqdPfL9Dkyvdtz9Mbweg/pfoWihdOS5BVHsO9syD4qAyvDvOIoEcvfGf1Qkqa
 VP34wb7f0IEbxTZatN4O73ZkPoelNLWvncoUZqmj9/l1nMkSv5FsrNG1ZdR+BAVyEa2NzRy9NsBx9
 efPrhxRNXNNmVHoEENMTyQ==;
Date: Wed, 10 Jan 2024 15:55:47 +0200
Message-Id: <83y1cxmgws.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87sf35pcds.fsf@localhost> (message from Ihor Radchenko on Wed,
 10 Jan 2024 13:05:19 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
 <83cyu9nyea.fsf@HIDDEN> <87sf35pcds.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org,
>  manikulin@HIDDEN, iota@HIDDEN
> Date: Wed, 10 Jan 2024 13:05:19 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I said that remapping widely-used keys to commands that behave
> > significantly differently places a non-trivial burden on users,
> > especially on those who use the remapping mode relatively rarely.
> 
> Sure. From which I concluded that Org mode should avoid remapping and
> instead prefer other means to adjust the behaviour of standard Emacs
> commands.
> 
> Then, we discussed that Emacs commands to not always provide enough
> toggles. So, I am asking to add one in this thread.

I don't think I understand what kind of toggle are we talking about.




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 13:47:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 08:47:59 2024
Received: from localhost ([127.0.0.1]:39247 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNYw2-00031K-VN
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:47:59 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:54278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rNYvo-0002ww-Tu
 for 65734 <at> debbugs.gnu.org; Wed, 10 Jan 2024 08:47:45 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rNY5Q-0003fC-Eq; Wed, 10 Jan 2024 07:53:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Hcah277+liqj5dk9zeAChrhbUFJplvJESoTOLMNB6k8=; b=GxnQ9WGb7LwQ
 Ay7sAoJjZ5LtVJ6d257HdVbJ137xbWuDEu6JHJJmW8Ud5ajUJYSXmz64JhL4Us0grbthxh+j6vOab
 Kc/rdHWDIaRGz/fjFFJklDl2ckmyG+ggbHkUSSM6XeXu3DRoIB0BncsT9l5sxvuYfvE94+2jXm+a5
 g538Py79nQ5r+NpD622yTCNfZxRStl1uSsmzynkVFZ4w5/Zu129MUaJ+bgfsV9e2CS6IfHpiTyGbQ
 x6jYny8/0vDgT4de+tX6f7Ne85VDatLJUpdvwPRxozz4XVY2S4d8sAAD1x/o86T8UlCGBpcQwLWNS
 r9Dl/LiV9vwXuaGXMTwVIg==;
Date: Wed, 10 Jan 2024 14:52:45 +0200
Message-Id: <83cyu9nyea.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87frz6w2zt.fsf@localhost> (message from Ihor Radchenko on Tue,
 09 Jan 2024 22:33:58 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN> <87frz6w2zt.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 monnier@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
>  65734 <at> debbugs.gnu.org, Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
> Date: Tue, 09 Jan 2024 22:33:58 +0000
> 
> Stefan Monnier <monnier@HIDDEN> writes:
> 
> >> Although, I am still interested to pursue feature request to allow
> >> customizing `kill-whole-line' and `kill-line' by major modes.
> >
> > [ I'm sorry I didn't pay very much attention to this part.
> >   Naively, I'd suggest you use `remap` bindings for that, but I'm sure
> >   you're aware of that option, so you presumably have good reasons to
> >   want something else.  ]
> 
> Eli told me in the past that Org mode should not remap keys.
> See the discussion branch starting at
> https://yhetil.org/emacs-devel/8735gfs3is.fsf@localhost/

I said that remapping widely-used keys to commands that behave
significantly differently places a non-trivial burden on users,
especially on those who use the remapping mode relatively rarely.




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Jan 2024 03:08:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 22:08:48 2024
Received: from localhost ([127.0.0.1]:41491 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNOxU-0003xj-MT
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 22:08:48 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25838)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rNOxT-0003xR-DM
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 22:08:47 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 85479100068;
 Tue,  9 Jan 2024 22:08:34 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704856110;
 bh=ovY0Tcc6Vj1WK0oek5bPjbuBlNEVCE59OhHWLn7Ysfg=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=oxAAIhlSC71Bv9F61ufEdTDUwISPnvy8pCSJUWqY0ByO5VTYHTD+6cIVEpj2B8qzc
 jQyrB4f2fVLf9sInL8nACK3c2HkY/GcjzW5+lRrJudZ4YEpWbFyD5nWD1m1Pikwl/x
 p3J4X0P/JmTGQ/GDtub+Npr3p68ywPrPc7mUtNyknai7ZxwASmqXUjpKT3NxjzfuAc
 ww1RTBHLnVgDYArb/KXcv4o8peM0D1T/5eNvHVA+g+e3NKkBRPdMWPmnmwoBuVLqbD
 PLflme+d0geOMrMc/j3XDVfjqbYweJYwN3gdQVd5/Tak2zeyjeazceBO12D2dvqKwG
 ENXOkU3rpCrrQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9451610004C;
 Tue,  9 Jan 2024 22:08:30 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5A821120426;
 Tue,  9 Jan 2024 22:08:30 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87frz6w2zt.fsf@localhost> (Ihor Radchenko's message of "Tue, 09
 Jan 2024 22:33:58 +0000")
Message-ID: <jwvv881ubrx.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <875y02y0da.fsf@localhost> <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
 <87frz6w2zt.fsf@localhost>
Date: Tue, 09 Jan 2024 22:08:28 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.255 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

> Eli told me in the past that Org mode should not remap keys.
> See the discussion branch starting at
> https://yhetil.org/emacs-devel/8735gfs3is.fsf@localhost/

Then I'll let Eli take care of this :-)


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 22:31:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 17:31:03 2024
Received: from localhost ([127.0.0.1]:41202 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNKcg-00082A-P7
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 17:31:03 -0500
Received: from mout01.posteo.de ([185.67.36.65]:57515)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNKcd-0007nN-5b
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 17:31:00 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 755D0240027
 for <65734 <at> debbugs.gnu.org>; Tue,  9 Jan 2024 23:30:46 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704839446; bh=/4ELPFb7UOM8wyssJl39FO98AyosA9MlaC1LoyXgMR4=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=dVhcDWCCeIqrmksYhIGhn5ULwe86Dfw7YS/aWaMveTE3lNsblgy4NE9SN7GJBlRON
 yOuWStNbK5mJBk0ZqcXOxOYapachQFvUthJKYQQbk/j+fyv9IhEyvWYmllNU0vBEap
 wOfecjnYFeKROWliGZ9uWrIyCNgZkkXQL2JEy5WvzznQ+bg9abVPGMYLaT6h9pU0rE
 LSuzp9K9/JdrUkj04cB/NhfJzErMWTUMbAJl18hbYl5TB/X1Ude2+P+PZ4wllW3WaK
 AAW51Xj6wrS5zuN4wrpKvoabPc1qcLqa9KeIteIs+kKhNRS7gu5LKtbmzJYP+I11wg
 86pUXdzDaZzEg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T8lxx4W8Hz9rxF;
 Tue,  9 Jan 2024 23:30:45 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost>
 <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
Date: Tue, 09 Jan 2024 22:33:58 +0000
Message-ID: <87frz6w2zt.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> Although, I am still interested to pursue feature request to allow
>> customizing `kill-whole-line' and `kill-line' by major modes.
>
> [ I'm sorry I didn't pay very much attention to this part.
>   Naively, I'd suggest you use `remap` bindings for that, but I'm sure
>   you're aware of that option, so you presumably have good reasons to
>   want something else.  ]

Eli told me in the past that Org mode should not remap keys.
See the discussion branch starting at
https://yhetil.org/emacs-devel/8735gfs3is.fsf@localhost/

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 22:18:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 17:18:31 2024
Received: from localhost ([127.0.0.1]:41186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNKQZ-0005Yw-II
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 17:18:31 -0500
Received: from mout02.posteo.de ([185.67.36.66]:35983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNKQW-0005Yg-BG
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 17:18:29 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 250A5240103
 for <65734 <at> debbugs.gnu.org>; Tue,  9 Jan 2024 23:18:14 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704838695; bh=cUPAYiqGO/8H0OVcAb4skYGH19tibn4HFG07iYlZ2UQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=HsUxRXYmp6pdwJjd5iPplFpsQgsjBDfijRsNkLv+ohcWlYcKxw8zkITC6dn1OCBkW
 dKFrG9IE5ULBWsHrrrEmxOBt3iRM+ZjZoFelHWHgFFH7wC0rmjjnOPzZqqbrQT2WC8
 ++fYLMLXZL3zcerwUJgmshUp0+A/hSaOhAs44SM0WL8Xp7yzlRBv/8qfzXq0yLcRp5
 MUaRXJIQ6Vwp9ZB/ghqQhzzNNxUuZPBhqdjE+JKgNs7toc/NyXESXntVhsYofx4xXK
 /Nq0Jt/GgdMO7OIkUmg98q5maFwZZB5vL5nTVxbDjdgElrFcevxuO2BGcUm+j/F2wm
 yTcJUknCHlfmg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T8lgV0wJwz9rxD;
 Tue,  9 Jan 2024 23:18:13 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwvr0iqv4ie.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <jwvcyub26fb.fsf-monnier+emacs@HIDDEN>
 <878r4yy2wu.fsf@localhost> <jwvr0iqv4ie.fsf-monnier+emacs@HIDDEN>
Date: Tue, 09 Jan 2024 22:21:26 +0000
Message-ID: <87il42w3kp.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> It would be nice if this advice were added to the relevant docstrings.
>
> Not sure exactly which advice you're referring to (the text you quoted
> above is misleading: it would encourage the naive reader to just do the
> work in `after-change-functions` since it's called only once per command
> anyway, which they already instinctively do and which is exactly what we
> don't want), nor which docstring you're referring to.

I was mostly referring to the docstring of `after-change-functions'.
Maybe also
`modification-hooks'\=E2=80=98insert-in-front-hooks=E2=80=99\=E2=80=98inser=
t-behind-hooks=E2=80=99 text
properties.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 16:48:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 11:48:41 2024
Received: from localhost ([127.0.0.1]:40766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNFHM-0006YB-Py
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 11:48:41 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rNFHL-0006XS-JC
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 11:48:40 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2692380DB3;
 Tue,  9 Jan 2024 11:48:27 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704818906;
 bh=xKY2a275EZsnbx13QiOhunmJ8ldGEzGhXN7G0Eb4X5A=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=BVmGYr7+JXWcPEuYmBQE+wIUrEJX5vlGY4HupgGJgVayXz2nEC1b+8h8ROpixVLG0
 z8N3dRA8IoWMW78qf4Wqer+/usShG0Ge2BQJNlbpzxVMjSU6p6dBaVjuGsYuyv4Mrq
 A2fNc0j6RhKndQYJT3+bdQjl3bt0FmGtgxpSLldUxlpBfjKEG6P5xOaI6AF8iQqs6+
 cuOYPcBsIlzZsYjY/PNHvNRkZeQyYpMAJWM44mLUuY8mIFtLogqTXbVn5o2geS8NO/
 SJbh3Hixh9+yfUHsWFHS0886XTLpviKHfgLkn2OqCeGBXhi9ew7a3zyKo+OGCQq1Y7
 tZ58HwwzXX5gw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F230B80CC9;
 Tue,  9 Jan 2024 11:48:25 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE6F6120426;
 Tue,  9 Jan 2024 11:48:25 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <878r4yy2wu.fsf@localhost> (Ihor Radchenko's message of "Tue, 09
 Jan 2024 14:52:49 +0000")
Message-ID: <jwvr0iqv4ie.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <jwvcyub26fb.fsf-monnier+emacs@HIDDEN> <878r4yy2wu.fsf@localhost>
Date: Tue, 09 Jan 2024 11:48:24 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.003 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

>> That's why I said "rule of thumb": there can be tradeoffs.
>> In practice 99% of Emacs commands modify only a single contiguous chunk
>> of text, so the tradeoff comes into play fairly rarely.
> It would be nice if this advice were added to the relevant docstrings.

Not sure exactly which advice you're referring to (the text you quoted
above is misleading: it would encourage the naive reader to just do the
work in `after-change-functions` since it's called only once per command
anyway, which they already instinctively do and which is exactly what we
don't want), nor which docstring you're referring to.


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 16:01:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 11:01:45 2024
Received: from localhost ([127.0.0.1]:40707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNEXw-0005s3-UW
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 11:01:45 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10304)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rNEXs-0005rl-Cf
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 11:01:43 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 96743100068;
 Tue,  9 Jan 2024 11:01:27 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704816086;
 bh=v8Cu8hji29G32K+i2NCVQKswRVUUdDK8WHwDD1yDpsY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=d203HkjCEwOiEC/IqKB17MPKKawQuMgW7FAJZ4vxRJfp5AG3cMPyBIMv/dTuXJUzp
 oXNopO21F4zm6fvAmny6RKo5pf7Xepy6UcscU0GoatvJJ7b5VEd8i+o6sjdU2yevIx
 7S5y092RAgVYeP51K+fiBIL0jGw/JG4Oe65+hL2BcIdPeRHlnBfwCFH01GQWDYtlb9
 fcRg55MGe/T1CNTGuL85v47E6P3aY6DinmgG6Y/Id4ktzqxg2Vv1Nv6oiGUjKO/6pR
 6645U1YgnVbTDwgPmDYdnR6PgKIUrkhjRDkR5m77KoRGDO22F64G8+qM6T0DkZc9Vf
 cskzChHm/gayw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4BDB510004C;
 Tue,  9 Jan 2024 11:01:26 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 09A02120BBA;
 Tue,  9 Jan 2024 11:01:26 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <875y02y0da.fsf@localhost> (Ihor Radchenko's message of "Tue, 09
 Jan 2024 15:47:45 +0000")
Message-ID: <jwvwmsiv6pq.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
 <875y02y0da.fsf@localhost>
Date: Tue, 09 Jan 2024 11:01:24 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.252 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

>>> But in addition to that, I suspect that Org should probably not modify
>>> visibility directly from the modification hooks.  Instead, its
>>> modification hook function should just stash the info somewhere and then
>>> update the visibility later on, such as in a `post-command-hook`, timer,
>>> `pre-redisplay-functions`, younameit.
>> Good idea. At least, for this specific feature in Org mode.
> Now, done.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f9702a09e

Great, thanks!

> Although, I am still interested to pursue feature request to allow
> customizing `kill-whole-line' and `kill-line' by major modes.

[ I'm sorry I didn't pay very much attention to this part.
  Naively, I'd suggest you use `remap` bindings for that, but I'm sure
  you're aware of that option, so you presumably have good reasons to
  want something else.  ]


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 15:44:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 10:44:51 2024
Received: from localhost ([127.0.0.1]:40695 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNEHa-00008Z-R6
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 10:44:51 -0500
Received: from mout01.posteo.de ([185.67.36.65]:60329)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNEHY-00008I-0j
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 10:44:49 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 2915B24002A
 for <65734 <at> debbugs.gnu.org>; Tue,  9 Jan 2024 16:44:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704815075; bh=6O9IISuM70hvzxrbjoS28SRPmKT/l2AiMgrzosast6k=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=WwSfNu35f2izpyqlOQsMVXosHBvpNwyIKNY/Zp41Cb8ygZQ19TdJ+tm4AtuhQF01R
 bUVY2S0RvJ6YfUc5fsa7m3UguRup7YYV/s34Sykf5Kaj+apn89ARptJ5mvu5+/Yg1j
 af5D+/JI8wXTErWfQnoi1VhKzY7jl3huWoseyLOOTepNL4jvHvyiwKxtucMn94rorx
 SOLZCJdGcNG7ilyLywmiEv2gbWfFIFRF45KzFUkPSD5d5pqnzd2faTZ1bhv6YaXeOk
 VPHBdATRXzNdYNlpIy71VmB6FYLa57i2P6l8bUu+ov/wax8MCofsxbfl+MUl55FGW0
 UvW73S2o69lbg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T8ZxF5zhtz6tm4;
 Tue,  9 Jan 2024 16:44:33 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <875y04yq9s.fsf@localhost>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost>
Date: Tue, 09 Jan 2024 15:47:45 +0000
Message-ID: <875y02y0da.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

Ihor Radchenko <yantar92@HIDDEN> writes:

> Stefan Monnier <monnier@HIDDEN> writes:
>
>> But in addition to that, I suspect that Org should probably not modify
>> visibility directly from the modification hooks.  Instead, its
>> modification hook function should just stash the info somewhere and then
>> update the visibility later on, such as in a `post-command-hook`, timer,
>> `pre-redisplay-functions`, younameit.
>
> Good idea. At least, for this specific feature in Org mode.

Now, done.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f9702a09e

Although, I am still interested to pursue feature request to allow
customizing `kill-whole-line' and `kill-line' by major modes.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 9 Jan 2024 14:49:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 09:49:55 2024
Received: from localhost ([127.0.0.1]:38836 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNDQQ-0007CK-MF
	for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 09:49:54 -0500
Received: from mout02.posteo.de ([185.67.36.66]:42369)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rNDQN-0007C7-Sm
 for 65734 <at> debbugs.gnu.org; Tue, 09 Jan 2024 09:49:53 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 63058240105
 for <65734 <at> debbugs.gnu.org>; Tue,  9 Jan 2024 15:49:39 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704811779; bh=R8VDZcDi7IYNeAouQ5evwtp/Z5gHE6EZj4+M+8Zpii0=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=iTShP9MzALDDrUEPizLmvw3girdWjdcWRJkZKAGiCEawqR1VFBArsr6AeXhqAAtj2
 akyvQqOUVn6SjO0J4+Nzcfvefkf+NV9t68S8ABacHdjrn3faCqmlYavv2l6NTjSZ1u
 MVCTMwmzxi3ZvMZEhctEt7BA3ag89i2IIUUc3ih+hfgO9PyrqiTlJg3NUlEFHT4Pku
 sDAmvTTeyM8pDHggP2ewn7muve1gTWgeJ0h/h/I0njXaRXg1c+b5LwiG+0upwcgaQB
 +91NvuDvjbulVzNar4LFcoujar/E0Ptr6CLl0ZsMgjiyuNLIL5atMjuZJTKUyZ6Bn9
 0t5NRCgRqlJcw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T8Yjt3SJVz9rxB;
 Tue,  9 Jan 2024 15:49:38 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwvcyub26fb.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
 <875y04yq9s.fsf@localhost> <jwvcyub26fb.fsf-monnier+emacs@HIDDEN>
Date: Tue, 09 Jan 2024 14:52:49 +0000
Message-ID: <878r4yy2wu.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> That's why I said "rule of thumb": there can be tradeoffs.
> In practice 99% of Emacs commands modify only a single contiguous chunk
> of text, so the tradeoff comes into play fairly rarely.

It would be nice if this advice were added to the relevant docstrings.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 8 Jan 2024 15:34:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 08 10:34:03 2024
Received: from localhost ([127.0.0.1]:37311 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMrdb-0005sB-Ks
	for submit <at> debbugs.gnu.org; Mon, 08 Jan 2024 10:34:03 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62104)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rMrdW-0005rb-QZ
 for 65734 <at> debbugs.gnu.org; Mon, 08 Jan 2024 10:34:01 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 325C6100115;
 Mon,  8 Jan 2024 10:33:47 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704728021;
 bh=GjHtmJu/OrYIOYz8sKCRsrVTvgSIo+ofw1n4boZ5NYw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=bKW619XAmILr6YjWAwTeX6WxPvgJ14ujJ9ftoaUzhtwfghLCT89SG8UHDflW3LYNb
 Rhai5UAPxTKz2yMmp5c4LaBITSsi+iKX9q9hHSlsFHhoEBWq+KQGuEprjg8uIKwxrW
 cX2vD+gaWqgBfONrnTrkcm38GAOfAB1IMzpLptmJCyWyAgV3qx+CTXItejc8swUqzY
 hh2kVw21qWpoBp8nHLUi7v5euNEY+yla5BzbpusvPJy80+OfVXgzMJu9LxmBxJSmOJ
 r72oYFRFzmUwTYef0aow0Uv1V54CK39lArAveNTZ7ri8aHJLbJmnLDlBGaPWagLHB3
 AP8781oyGlCoQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B729310004C;
 Mon,  8 Jan 2024 10:33:41 -0500 (EST)
Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E2F4120BE4;
 Mon,  8 Jan 2024 10:33:41 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <875y04yq9s.fsf@localhost> (Ihor Radchenko's message of "Mon, 08
 Jan 2024 12:15:59 +0000")
Message-ID: <jwvcyub26fb.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
 <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN> <875y04yq9s.fsf@localhost>
Date: Mon, 08 Jan 2024 10:33:40 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.260 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

>> As a rule of thumb, I think modification hooks should be treated a bit
>> like POSIX signal handlers: just record the event somewhere but don't do
>> any substantial work in there.
> Yet, it is sometimes necessary to modify text right inside the
> modification hooks. Otherwise, it is very hard (and sometimes
> impossible) to keep track of the original text region when multiple
> modifications happen there one by one.

It's always "possible", but yes there can be undesirable effects:
usually as you delay the updates you're forced to reduce the granularity
of the recorded changes, so in you may end up treating a series of small
changes as one big-ass change for which your updates may not be able to
do as good a job.

E.g. in `diff-mode` we try to allow editing the patch, and dynamically
update the hunk headers accordingly.  This works well for an edit within
a single hunk but doing it for larger edits is somewhere between hard
and undesirable so we don't do it.

If a command changes just two lines but in two different hunks, our code
treats it a a single change that spans two hunks and thus refrains from
updating the hunk headers, as if the command had actually deleted and
then reinserted all the text between those two lines.

That's why I said "rule of thumb": there can be tradeoffs.
In practice 99% of Emacs commands modify only a single contiguous chunk
of text, so the tradeoff comes into play fairly rarely.


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 8 Jan 2024 12:13:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 08 07:13:05 2024
Received: from localhost ([127.0.0.1]:35364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMoV7-00060p-Ag
	for submit <at> debbugs.gnu.org; Mon, 08 Jan 2024 07:13:05 -0500
Received: from mout01.posteo.de ([185.67.36.65]:60925)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rMoV3-00060F-9l
 for 65734 <at> debbugs.gnu.org; Mon, 08 Jan 2024 07:13:03 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 87856240028
 for <65734 <at> debbugs.gnu.org>; Mon,  8 Jan 2024 13:12:47 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1704715967; bh=KILi8RYFXyxi+QwjQYjDTCUZO/LJPCbOqbujPIR3qXI=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=QlkswDRl1sUo/07eZJNCUrg2Mv04pwnLCZGeVsgVarh147BWpSL8O2QwU4AkwqcsT
 quwQOQaUsY7HNpbECHwioPbJ79WJfSR0wY1oasxBS/SGfAANJ5/4jNLSMGgN+nNRuC
 YWEAcc90fcB97qE0Asllht9iozyZpPpbfVXknTm+8E7un+Thx2co2EqWGYxFPL2cqA
 ecSJmSjGFi1Kq6L5/9IJkxfkTL68jCtPxhD63TSpCT+OauiLYmg/baTjX8M9s4IWG7
 h2VAcTJXsa2dfZnPnxgWZhNEt+kfkKoRAuFwnBDJ59OMVuEfAOGm7RFJy5myrpC1mc
 p9enGSTsm0sqg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4T7tHL3Qqnz6tx8;
 Mon,  8 Jan 2024 13:12:46 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost> <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
Date: Mon, 08 Jan 2024 12:15:59 +0000
Message-ID: <875y04yq9s.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> But in addition to that, I suspect that Org should probably not modify
> visibility directly from the modification hooks.  Instead, its
> modification hook function should just stash the info somewhere and then
> update the visibility later on, such as in a `post-command-hook`, timer,
> `pre-redisplay-functions`, younameit.

Good idea. At least, for this specific feature in Org mode.

> As a rule of thumb, I think modification hooks should be treated a bit
> like POSIX signal handlers: just record the event somewhere but don't do
> any substantial work in there.

Yet, it is sometimes necessary to modify text right inside the
modification hooks. Otherwise, it is very hard (and sometimes
impossible) to keep track of the original text region when multiple
modifications happen there one by one.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Jan 2024 16:27:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 11:27:29 2024
Received: from localhost ([127.0.0.1]:33627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMVzl-0003gK-Ar
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2024 11:27:29 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16051)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rMVzj-0003g5-Id
 for 65734 <at> debbugs.gnu.org; Sun, 07 Jan 2024 11:27:27 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 19468440FCC;
 Sun,  7 Jan 2024 11:27:16 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704644834;
 bh=NdtNLcceqDietQBaDvf+Yo8fmComWlOH5XE+JHZA+pk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=hnbK6/Ola5J1C+qC2x+VxY2Ulr6+o/HMMaZ3JZ9Ug57PgZVra1k3/ZI3SW8wCFYfY
 S9tCOf11V7kCigyvK1OT50e3lOO6BocS5LF50Hf+/idjlk5bgcasuqrgMWGxO20CYs
 HivM5mefdqghFqlNXi9IwIaBpKZw2xKtqVDRVV9b2NpckLMjZb/izjYuBon6n8Nc/b
 rGHH6Rc8jRn0yJwT5r+Gp2c1h98YfO0OYHXhETw3lclDLRVyCcQKqg7l04Ed9iJsEa
 1hIvbJ/hh3J18RHevcJpZBHD905Qt20EPp+OS1910SISerav/lQ2kG2FrEUdJZqBP4
 vYbpuM++revig==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 935C6440F0A;
 Sun,  7 Jan 2024 11:27:14 -0500 (EST)
Received: from milanesa (65-110-221-238.cpe.pppoe.ca [65.110.221.238])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4E1041208A5;
 Sun,  7 Jan 2024 11:27:14 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <875y4ovct9.fsf@localhost> (Ihor Radchenko's message of "Tue, 05
 Sep 2023 15:50:58 +0000")
Message-ID: <jwvzfxhf7nq.fsf-monnier+emacs@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
 <83cyyw4of7.fsf@HIDDEN> <875y4ovct9.fsf@localhost>
Date: Sun, 07 Jan 2024 11:27:13 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.111 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <at> debbugs.gnu.org,
 Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN
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 (---)

> The reported bug is a side effect of a feature when Org automatically
> reveals hidden outlines that are "broken" due to edits and thus could
> not be unfolded easily. For example, when destroying parent heading in a
> folding subtree:

I'd be in favor of changing `kill-whole-line` to do the kill in a single
step rather than killing the "before" and "after" separately.
I understand why it doesn't do that, but I'm not sure it's worth the
trouble (or we should change the `kill-region` thingy to be more
robust, e.g. record the position of the last kill so that it doesn't
need to rely on (< end beg) to guess whether to append or prepend and
it can automatically notice when the new kill is *around* the previous
one).

But in addition to that, I suspect that Org should probably not modify
visibility directly from the modification hooks.  Instead, its
modification hook function should just stash the info somewhere and then
update the visibility later on, such as in a `post-command-hook`, timer,
`pre-redisplay-functions`, younameit.

As a rule of thumb, I think modification hooks should be treated a bit
like POSIX signal handlers: just record the event somewhere but don't do
any substantial work in there.


        Stefan





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

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


Received: (at 65734) by debbugs.gnu.org; 6 Jan 2024 08:58:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 03:58:58 2024
Received: from localhost ([127.0.0.1]:58534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rM2WA-0004Rg-5K
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 03:58:58 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:59720)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rM2W8-0004RS-CP
 for 65734 <at> debbugs.gnu.org; Sat, 06 Jan 2024 03:58:57 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rM2Vx-0004xS-Sh; Sat, 06 Jan 2024 03:58:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=DCdmy3OUJketNIUnu0WDHXcWt9YUiTstTQbwdbB61eU=; b=R/Sm1DkaPq9d
 FqwwBBZySQ1Li6R4gphFedQHoNpasob6RQx3TFHsR7kmDCEO8uOOvjqUk8uI+EMvY9nmJuu9swP5r
 YdEUh2BCi53tTrmNDAM8sgTLWVBR/nzrS0yGr48OmtNm2UiKoJuhvLdLOOhLbpI7aOdRczzkzcTY8
 v4B5kK3qQW0eXf3ObwZq5LptejAnjxlxmV5oIBD98YI1suV2nDgdvCOew8QgKaKls7K/xgt6zFsxb
 WN3IKoMiqBKlfcaJjnJJyaQCCRT5IBQ+E2qNnr2ZpjEBR+uvta85qw7r4XNnw4zM/fyFdtCaFOr4z
 wCyZyPGusx5PQPYWGjnBBw==;
Date: Sat, 06 Jan 2024 10:58:36 +0200
Message-Id: <83mstiu9c3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87o7eew0is.fsf@HIDDEN> (message from Sebastian Miele on Mon, 
 25 Dec 2023 19:53:36 +0100)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN> <8334zmrmnu.fsf@HIDDEN>
 <87o7eew0is.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: yantar92@HIDDEN, 65734 <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 (---)

> From: Sebastian Miele <iota@HIDDEN>
> Cc: 65734 <at> debbugs.gnu.org, yantar92@HIDDEN
> Date: Mon, 25 Dec 2023 19:53:36 +0100
> 
> Attached are two patches.  The first patch introduces the tests,
> including two tests that are expected to be failing for the current
> `kill-whole-line'.
> 
> The test `kill-whole-line-read-only' does not fail because of the bug
> reported in this bug report, but because of another bug that I stumbled
> upon while investigating and testing: `kill-whole-line' always kills by
> two calls to `kill-region'.  When the buffer is readonly, the first of
> the two calls to `kill-region' errors out / exits non-locally.  That
> causes `kill-region' to omit to put the remaining stuff (from the second
> `kill-region') into the kill ring.
> 
> The second patch fixes both bugs, and removes the corresponding
> `:expected-result :failed' from the tests.

Thanks.

The patches lack suitable ChangeLog-style commit log messages (see
CONTRIBUTE for details and you can use "git log" to show examples of
how we do this).

I'd also ask Stefan Monnier and Stefan Kangas to review the patch,
since this is an important command and I would like to avoid breaking
it.




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

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


Received: (at 65734) by debbugs.gnu.org; 25 Dec 2023 19:22:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 25 14:22:28 2023
Received: from localhost ([127.0.0.1]:55400 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rHqWw-0001Od-Un
	for submit <at> debbugs.gnu.org; Mon, 25 Dec 2023 14:22:27 -0500
Received: from mout-p-202.mailbox.org ([80.241.56.172]:47628)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1rHqWt-0001ON-Du
 for 65734 <at> debbugs.gnu.org; Mon, 25 Dec 2023 14:22:25 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4SzST95Mdvz9sSS;
 Mon, 25 Dec 2023 20:22:05 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1703532125;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=8L4a+Z9DwOxbiBMrD4nxZvRQ6A8Hgz/5wzHH8PYaOeI=;
 b=cP3ERtE2pJj7jdzPvOBBu94GKFMSJHZ2znrd1+oIkcshVVi4La4p+NOvhyUNjE+ZNZitES
 tEfftx6RPT0LjiluojM2vLbjVELav8kRhuI43qnp0Ne2wfC733Zh3Kk5zaquDW77zy/+dY
 ZL4Ki4V3ac9duM3i4OADpw7ocz8ZeS6NHPsTfOwdUtFQ74vnODeRcNNeyWraEMfb1wEM62
 oz+q/kuMqW4OltKvUSRDaHHkyvS6GMeFzTJ8VrEVJ4/KiAhfHgziGUoZMcvEiE8p+XHXQN
 ygkHJZEawhLhF8VRNFHBuZI5he5q3ZYf3I/5twMdsEwqdbTQmdblLS0IRiht/w==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN> <8334zmrmnu.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Mon, 25 Dec 2023 19:53:36 +0100
In-reply-to: <8334zmrmnu.fsf@HIDDEN>
Message-ID: <87o7eew0is.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: yantar92@HIDDEN, 65734 <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: -1.7 (-)

--=-=-=
Content-Type: text/plain

Attached are two patches.  The first patch introduces the tests,
including two tests that are expected to be failing for the current
`kill-whole-line'.

The test `kill-whole-line-read-only' does not fail because of the bug
reported in this bug report, but because of another bug that I stumbled
upon while investigating and testing: `kill-whole-line' always kills by
two calls to `kill-region'.  When the buffer is readonly, the first of
the two calls to `kill-region' errors out / exits non-locally.  That
causes `kill-region' to omit to put the remaining stuff (from the second
`kill-region') into the kill ring.

The second patch fixes both bugs, and removes the corresponding
`:expected-result :failed' from the tests.

> From: Eli Zaretskii <eliz@HIDDEN>
> Date: Sun, 2023-09-10 19:57 +0300
>
>> From: Sebastian Miele <iota@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>, Ihor Radchenko <yantar92@HIDDEN>
>> Date: Sun, 10 Sep 2023 18:31:20 +0200
>>
>> I removed emacs-orgmode@HIDDEN from CC.
>>
>> > From: Sebastian Miele <iota@HIDDEN>
>> > Date: Wed, 2023-09-06 15:30 +0200
>> >
>> > I will write the tests.  And I will probably come up with an updated
>> > version of the original patch.  There is at least one cosmetic change.
>> > And something else that I want to have tried.  May take some time.
>>
>> Please have a look at the following patch.  For now it contains three
>> tests, two of them with :expected-result :failed.  (They do not fail on
>> the bug-fixed version of `kill-whole-line'.)
>
> Yes, there should be more tests, ideally: there are situations where
> kill-whole-line signals an error, and I don't think I see tests where
> some of the text is invisible (as the function uses
> forward-visible-line and end-of-visual-line).

I added tests for cases when `kill-whole-line' signals errors.

The tests for the invisible stuff were already there, in the test
`kill-whole-line-invisible'.  The calls that introduce invisibility and
`after-change-functions' in the test are:

  (org-mode)
  (org-fold-hide-sublevels 1)

Even though its only five tests, I think they are rather very thorough,
now.  Except one test, all tests tests have several subtests.  All
branches of `kill-whole-line' are covered.

>> There probably will be more tests and further questions.  But for
>> now, I would like to basically have a statement of whether the style
>> of writing the tests goes in an acceptable direction.
>
> Looks reasonable, but I'm not sure I understand what will the test
> show if one of the tests fails: will the information shown then tell
> enough to understand which of the sub-tests failed and why?

I found the `ert-info' macro which allows to add arbitrary annotiations
to `should's in its body, used it for all subtests.  They now are
clearly distinguishable in the output of `ert', even when run from a
terminal.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=tests.patch

diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 28d8120f143..e6d3ffe8d34 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -22,6 +22,7 @@
 ;;; Code:
 
 (require 'ert)
+(require 'ert-x)
 (eval-when-compile (require 'cl-lib))
 
 (defun simple-test--buffer-substrings ()
@@ -40,6 +41,49 @@ simple-test--dummy-buffer
      ,@body
      (with-no-warnings (simple-test--buffer-substrings))))
 
+(defconst simple-test-point-tag "<POINT>")
+(defconst simple-test-mark-tag "<MARK>")
+
+(defun simple-test--set-buffer-text-point-mark (description)
+  "Set the current buffer's text, point and mark according to
+DESCRIPTION.
+
+Erase current buffer and insert DESCRIPTION.  Set point to the
+first occurrence of `simple-test-point-tag' (\"<POINT>\") in the
+buffer, removing it.  If there is no `simple-test-point-tag', set
+point to the beginning of the buffer.  If there is a
+`simple-test-mark-tag' (\"<MARK>\"), remove it, and set an active
+mark there."
+  (erase-buffer)
+  (insert description)
+  (goto-char (point-min))
+  (when (search-forward simple-test-mark-tag nil t)
+    (delete-char (- (length simple-test-mark-tag)))
+    (push-mark (point) nil 'activate))
+  (goto-char (point-min))
+  (when (search-forward simple-test-point-tag nil t)
+    (delete-char (- (length simple-test-point-tag)))))
+
+(defun simple-test--get-buffer-text-point-mark ()
+  "Inverse of `simple-test--set-buffer-text-point-mark'."
+  (cond
+   ((not mark-active)
+    (concat (buffer-substring-no-properties (point-min) (point))
+            simple-test-point-tag
+            (buffer-substring-no-properties (point) (point-max))))
+   ((< (mark) (point))
+    (concat (buffer-substring-no-properties (point-min) (mark))
+            simple-test-mark-tag
+            (buffer-substring-no-properties (mark) (point))
+            simple-test-point-tag
+            (buffer-substring-no-properties (point) (point-max))))
+   (t
+    (concat (buffer-substring-no-properties (point-min) (point))
+            simple-test-point-tag
+            (buffer-substring-no-properties (point) (mark))
+            simple-test-mark-tag
+            (buffer-substring-no-properties (mark) (point-max))))))
+
 
 ;;; `count-words'
 (ert-deftest simple-test-count-words-bug-41761 ()
@@ -1046,5 +1090,190 @@ simple-tests-zap-to-char
     (with-zap-to-char-test "abcdeCXYZ" "XYZ"
       (zap-to-char 1 ?C 'interactive))))
 
+
+;;; Tests for `kill-whole-line'
+
+(ert-deftest kill-whole-line-invisible ()
+  :expected-result :failed
+  (cl-flet ((test (kill-whole-line-arg &rest expected-lines)
+              (ert-info ((format "%s" kill-whole-line-arg) :prefix "Subtest: ")
+                (ert-with-test-buffer-selected nil
+                  (simple-test--set-buffer-text-point-mark
+                   (string-join
+                    '("* -2" "hidden"
+                      "* -1" "hidden"
+                      "* A<POINT>B" "hidden"
+                      "* 1" "hidden"
+                      "* 2" "hidden"
+                      "")
+                    "\n"))
+                  (org-mode)
+                  (org-fold-hide-sublevels 1)
+                  (kill-whole-line kill-whole-line-arg)
+                  (should
+                   (equal (string-join expected-lines "\n")
+                          (simple-test--get-buffer-text-point-mark)))))))
+    (test 0
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test 1
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test 2
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>* 2" "hidden"
+          "")
+    (test 3
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>")
+    (test 9
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>")
+    (test -1
+          "* -2" "hidden"
+          "* -1" "hidden<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -2
+          "* -2" "hidden<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -3
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -9
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")))
+
+(ert-deftest kill-whole-line-read-only ()
+  :expected-result :failed
+  (cl-flet
+      ((test (kill-whole-line-arg expected-kill-lines expected-buffer-lines)
+         (ert-info ((format "%s" kill-whole-line-arg) :prefix "Subtest: ")
+           (ert-with-test-buffer-selected nil
+             (simple-test--set-buffer-text-point-mark
+              (string-join '("-2" "-1" "A<POINT>B" "1" "2" "") "\n"))
+             (read-only-mode 1)
+             (setq last-command #'ignore)
+             (should-error (kill-whole-line kill-whole-line-arg)
+                           :type 'buffer-read-only)
+             (should (equal (string-join expected-kill-lines "\n")
+                            (car kill-ring)))
+             (should (equal (string-join expected-buffer-lines "\n")
+                            (simple-test--get-buffer-text-point-mark)))))))
+    (test 0 '("AB") '("-2" "-1" "AB<POINT>" "1" "2" ""))
+    (test 1 '("AB" "") '("-2" "-1" "AB" "<POINT>1" "2" ""))
+    (test 2 '("AB" "1" "") '("-2" "-1" "AB" "1" "<POINT>2" ""))
+    (test 3 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
+    (test 9 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
+    (test -1 '("" "AB") '("-2" "-1<POINT>" "AB" "1" "2" ""))
+    (test -2 '("" "-1" "AB") '("-2<POINT>" "-1" "AB" "1" "2" ""))
+    (test -3 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))
+    (test -9 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))))
+
+(ert-deftest kill-whole-line-after-other-kill ()
+  (ert-with-test-buffer-selected nil
+    (simple-test--set-buffer-text-point-mark "A<POINT>X<MARK>B")
+    (setq last-command #'ignore)
+    (kill-region (point) (mark))
+    (deactivate-mark 'force)
+    (setq last-command #'kill-region)
+    (kill-whole-line)
+    (should (equal "AXB" (car kill-ring)))
+    (should (equal "<POINT>"
+                   (simple-test--get-buffer-text-point-mark)))))
+
+(ert-deftest kill-whole-line-buffer-boundaries ()
+  (ert-with-test-buffer-selected nil
+    (ert-info ("0" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "<POINT>")
+      (should-error (kill-whole-line -1)
+                    :type 'beginning-of-buffer)
+      (should-error (kill-whole-line 1)
+                    :type 'end-of-buffer))
+    (ert-info ("1a" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\n<POINT>")
+      (should-error (kill-whole-line 1)
+                    :type 'end-of-buffer))
+    (ert-info ("1b" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\nA<POINT>")
+      (setq last-command #'ignore)
+      (kill-whole-line 1)
+      (should (equal "-1\n<POINT>"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "A" (car kill-ring))))
+    (ert-info ("2" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "<POINT>\n1")
+      (should-error (kill-whole-line -1)
+                    :type 'beginning-of-buffer))
+    (ert-info ("2b" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "<POINT>A\n1")
+      (setq last-command #'ignore)
+      (kill-whole-line 1)
+      (should (equal "<POINT>1"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "A\n" (car kill-ring))))))
+
+(ert-deftest kill-whole-line-line-boundaries ()
+  (ert-with-test-buffer-selected nil
+    (ert-info ("1a" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\n<POINT>\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line 1)
+      (should (equal "-1\n<POINT>1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "\n" (car kill-ring))))
+    (ert-info ("1b" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\n<POINT>\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line -1)
+      (should (equal "-1<POINT>\n1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "\n" (car kill-ring))))
+    (ert-info ("2a" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\nA<POINT>\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line 1)
+      (should (equal "-1\n<POINT>1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "A\n" (car kill-ring))))
+    (ert-info ("2b" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\nA<POINT>\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line -1)
+      (should (equal "-1<POINT>\n1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "\nA" (car kill-ring))))
+    (ert-info ("3a" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\n<POINT>A\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line 1)
+      (should (equal "-1\n<POINT>1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "A\n" (car kill-ring))))
+    (ert-info ("3b" :prefix "Subtest: ")
+      (simple-test--set-buffer-text-point-mark "-1\n<POINT>A\n1\n")
+      (setq last-command #'ignore)
+      (kill-whole-line -1)
+      (should (equal "-1<POINT>\n1\n"
+                     (simple-test--get-buffer-text-point-mark)))
+      (should (equal "\nA" (car kill-ring))))))
+
 (provide 'simple-test)
 ;;; simple-tests.el ends here

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix.patch

diff --git a/lisp/simple.el b/lisp/simple.el
index 6453dfbcd2b..1fd087538b7 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6640,28 +6640,53 @@ kill-whole-line
   (unless (eq last-command 'kill-region)
     (kill-new "")
     (setq last-command 'kill-region))
-  (cond ((zerop arg)
-	 ;; We need to kill in two steps, because the previous command
-	 ;; could have been a kill command, in which case the text
-	 ;; before point needs to be prepended to the current kill
-	 ;; ring entry and the text after point appended.  Also, we
-	 ;; need to use save-excursion to avoid copying the same text
-	 ;; twice to the kill ring in read-only buffers.
-	 (save-excursion
-	   (kill-region (point) (progn (forward-visible-line 0) (point))))
-	 (kill-region (point) (progn (end-of-visible-line) (point))))
-	((< arg 0)
-	 (save-excursion
-	   (kill-region (point) (progn (end-of-visible-line) (point))))
-	 (kill-region (point)
-		      (progn (forward-visible-line (1+ arg))
-			     (unless (bobp) (backward-char))
-			     (point))))
-	(t
-	 (save-excursion
-	   (kill-region (point) (progn (forward-visible-line 0) (point))))
-	 (kill-region (point)
-		      (progn (forward-visible-line arg) (point))))))
+  ;; - We need to kill in two steps, because the previous command
+  ;;   could have been a kill command, in which case the text before
+  ;;   point needs to be prepended to the current kill ring entry and
+  ;;   the text after point appended.
+  ;; - We need to be careful to avoid copying text twice to the kill
+  ;;   ring in read-only buffers.
+  ;; - We need to determine the boundaries of visible lines before we
+  ;;   do the first kill.  Otherwise `after-change-functions' may
+  ;;   change visibility (bug#65734).
+  (let (;; The beginning of both regions to kill
+        (regions-begin (point-marker))
+        ;; The end of the first region to kill.  Moreover, after
+        ;; evaluation of the value form, (point) will be the end of
+        ;; the second region to kill.
+        (region1-end (cond ((zerop arg)
+                            (prog1 (save-excursion
+                                     (forward-visible-line 0)
+                                     (point-marker))
+                              (end-of-visible-line)))
+	                   ((< arg 0)
+	                    (prog1 (save-excursion
+                                     (end-of-visible-line)
+                                     (point-marker))
+                              (forward-visible-line (1+ arg))
+	                      (unless (bobp) (backward-char))))
+	                   (t
+	                    (prog1 (save-excursion
+                                     (forward-visible-line 0)
+                                     (point-marker))
+	                      (forward-visible-line arg))))))
+    ;; - Pass the marker positions and not the markers themselves.
+    ;;   kill-region determines whether to prepend or append to a
+    ;;   previous kill by checking the direction of the region.  But
+    ;;   it deletes the content and hence moves the markers before
+    ;;   that.  That effectively makes every region delimited by
+    ;;   markers an (empty) forward region.
+    ;; - Make the first kill-region emit a non-local exit only if the
+    ;;   second kill-region below would not operate on a non-empty
+    ;;   region.
+    (let ((kill-read-only-ok (or kill-read-only-ok
+                                 (/= regions-begin (point)))))
+      (kill-region (marker-position regions-begin)
+                   (marker-position region1-end)))
+    (kill-region (marker-position regions-begin)
+                 (point))
+    (set-marker regions-begin nil)
+    (set-marker region1-end nil)))
 
 (defun forward-visible-line (arg)
   "Move forward by ARG lines, ignoring currently invisible newlines only.
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index e6d3ffe8d34..15f2db7e610 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -1094,7 +1094,6 @@ simple-tests-zap-to-char
 ;;; Tests for `kill-whole-line'
 
 (ert-deftest kill-whole-line-invisible ()
-  :expected-result :failed
   (cl-flet ((test (kill-whole-line-arg &rest expected-lines)
               (ert-info ((format "%s" kill-whole-line-arg) :prefix "Subtest: ")
                 (ert-with-test-buffer-selected nil
@@ -1162,7 +1161,6 @@ kill-whole-line-invisible
           "")))
 
 (ert-deftest kill-whole-line-read-only ()
-  :expected-result :failed
   (cl-flet
       ((test (kill-whole-line-arg expected-kill-lines expected-buffer-lines)
          (ert-info ((format "%s" kill-whole-line-arg) :prefix "Subtest: ")

--=-=-=--




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

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


Received: (at 65734) by debbugs.gnu.org; 4 Dec 2023 23:27:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 04 18:27:24 2023
Received: from localhost ([127.0.0.1]:36124 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rAILT-0000oy-Ts
	for submit <at> debbugs.gnu.org; Mon, 04 Dec 2023 18:27:24 -0500
Received: from mout-p-102.mailbox.org ([80.241.56.152]:44342)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1rAILR-0000ok-Md
 for 65734 <at> debbugs.gnu.org; Mon, 04 Dec 2023 18:27:23 -0500
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4SkfvW3vbsz9snW;
 Tue,  5 Dec 2023 00:27:03 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1701732423;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=HCD6FtUC3VQlHPW/kqcWaW6u+NzHBFrXkNt9S8Sdu78=;
 b=phx2z5+kKKxnUACKZpykJYQxAnIUZdJ4ZaztmXhUEP+YzbFeruDxHHBO8XPJmBPXf248JH
 MGRFbYrGRyrr5ginHSiIARiGXFj+y60m37Nh7a8Gsb4YLHYd/Efh52kh1Vmgm+Eo3j1a6h
 tvK5s8RlcAvOXdIEwexpDVtcVhBbiNu5dd01I0lO88QnKsrlh/B0ZhetZFj8Ve3XlnNHnH
 CDD209BhH80JXiYB6jOSv2r4cCpcw60+lBEIOm+oNK8k2qMgo4YzGMMLvZDF6XFYGY8dsE
 mZmlxJsHhGVx3ixOr5iT8+CQSN8iPpvEqcvWCp4o26rxXWLrh9ZBhOGHeGvpyA==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN> <877clugmvi.fsf@localhost>
From: Sebastian Miele <iota@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Tue, 05 Dec 2023 00:20:15 +0100
In-reply-to: <877clugmvi.fsf@localhost>
Message-ID: <87il5dv9a2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: Eli Zaretskii <eliz@HIDDEN>, 65734 <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: -1.7 (-)

Hi Ihor,

> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Mon, 2023-12-04 12:42 +0000
>
> Sebastian Miele <iota@HIDDEN> writes:
>
>>> I will write the tests.  And I will probably come up with an updated
>>> version of the original patch.  There is at least one cosmetic change.
>>> And something else that I want to have tried.  May take some time.
>> ...
>
> A gentle bump.
> If you encountered any difficulties, feel free to ask us anything. We
> will try to help.

I did not forget.  It is mostly finished since quite a while.  I will
come back to it and finish/polish it probably before the end of the
month.

Best wishes
Sebastian




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

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


Received: (at 65734) by debbugs.gnu.org; 4 Dec 2023 12:39:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 04 07:39:47 2023
Received: from localhost ([127.0.0.1]:33626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rA8El-0004mK-IB
	for submit <at> debbugs.gnu.org; Mon, 04 Dec 2023 07:39:47 -0500
Received: from mout02.posteo.de ([185.67.36.66]:36993)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1rA8Ei-0004m6-K9
 for 65734 <at> debbugs.gnu.org; Mon, 04 Dec 2023 07:39:45 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 22B22240103
 for <65734 <at> debbugs.gnu.org>; Mon,  4 Dec 2023 13:39:27 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1701693568; bh=Zz+QxeGw9fs3kIyyyjd1A8xZNWiIxcKC7gTFQMlyDiE=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=N3gmh0ou8bNfN63hDz8ty6YBsrgXjrNX34cKciRDzJ5eY4LCi2U56nnoPn9vOVWqB
 iXJbRKnja6dZqSGEEI7ihky0aP40ZcarqA9a7URs4anRuDzrPPZ1u5KRUXmklCoI4s
 DZmiU+bmy8zzav7+Q66fnwwLThlzEVpBKG9qOeQ7GofR4mtJ6ph4xaQ2HTW319wkvO
 d0LoNC1uWJjHCkujIVMJ/sZjyia42TxLM3VtwHnY/adI34Ar4ZObCmEfb7ICGEfmmH
 x0duBG2dpoRbxYbLnXwfwdRdy494IsE2Zhc5dFn619yPTX0RCdpj8pJkqiYgKgY1ki
 8EX821Ziu60+g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4SkNXH1xF6z6txq;
 Mon,  4 Dec 2023 13:39:27 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87zg1u0yrp.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN>
Date: Mon, 04 Dec 2023 12:42:25 +0000
Message-ID: <877clugmvi.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: Eli Zaretskii <eliz@HIDDEN>, 65734 <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 (---)

Sebastian Miele <iota@HIDDEN> writes:

>> I will write the tests.  And I will probably come up with an updated
>> version of the original patch.  There is at least one cosmetic change.
>> And something else that I want to have tried.  May take some time.
> ...

A gentle bump.
If you encountered any difficulties, feel free to ask us anything. We
will try to help.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Sep 2023 14:10:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 12 10:10:21 2023
Received: from localhost ([127.0.0.1]:59671 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qg45s-0006y8-SU
	for submit <at> debbugs.gnu.org; Tue, 12 Sep 2023 10:10:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qg45q-0006xo-NN
 for 65734 <at> debbugs.gnu.org; Tue, 12 Sep 2023 10:10:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qg45f-0008PV-EE; Tue, 12 Sep 2023 10:10:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=P+zKmfNNkRF9OMmHBh+ngeSSp3ox4hsQIQZ4pQ/Ngns=; b=DoYHCn3gBfI6
 kL5DXrS5EECZVhPJffaDOOm/zS1dpvXws1Pi4wFzd57SIi8FnA2eLMquRfwNEQrp1/KYDKtXuttmT
 xUCw3+8K6U6jKFliBVEW83ZskWSSDXPMSlUq5Ksd7ydWGK8EPkpkueAwX11HNk3anVPTuLYNQ6qKP
 JIQEaeKTZyEl0eQH67UmLf9RzjCqI89d4DkvELMD8dB6hKMTY1LPYRJi0QDMxPmpPu4H6ePELC1bc
 3c5mBxrfEYtaUkV+mkWlj9+qls8G3W8VdSuFddJkdX9dDE78D1P3XmFoSm75HMeRRUs3iq0iEXG3L
 LrgoFSOsi0zfHt+QU2yp4w==;
Date: Tue, 12 Sep 2023 17:09:52 +0300
Message-Id: <835y4fpjnz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
In-Reply-To: <87il8fbj8q.fsf@HIDDEN> (message from Sebastian Miele on Tue, 
 12 Sep 2023 15:04:41 +0200)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN> <8334zmrmnu.fsf@HIDDEN>
 <87il8fbj8q.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: yantar92@HIDDEN, 65734 <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 (---)

> From: Sebastian Miele <iota@HIDDEN>
> Cc: 65734 <at> debbugs.gnu.org, yantar92@HIDDEN
> Date: Tue, 12 Sep 2023 15:04:41 +0200
> 
> > Looks reasonable, but I'm not sure I understand what will the test
> > show if one of the tests fails: will the information shown then tell
> > enough to understand which of the sub-tests failed and why?
> 
> That almost certainly would not be immediately obvious in the current
> state.  I have next to no experience in working with testing frameworks.
> But I assumed that regressions do not happen that often, and that it
> would be good enough if the code of the test can be grasped quickly.
> Then, in case of a regression, the test code can be temporarily
> sprinkled with some printf-like debugging to find out the exact location
> in the test.
> 
> However, enough of that printf-like debugging could also be hard-coded,
> like in the following definition (see the line ending in the comment
> "Provide some context"):

It should be enough to have an indication of what sub-test failed.
Finding that out in a series of tests one of which fails is frequently
a very frustrating experience, especially if the test is written with
heavy use of macros, or generates testing code on the fly (or both).

> With the always succeeding
> 
>   (should `(subtest ,kill-whole-line-arg)) ; Provide some context
> 
> at the beginning of ervery subtest, the context would be clear after
> pressing l in a buffer showing the ERT test results (but never on the
> console).

I mostly run tests in batch mode, so my preference is to see some
telltale indication of the failed code when ERT reports the failure.

> An alternative would be to use `message'.  That would also provide the
> context on the console.  However, that also may be a bit noisy.

The "noise" is required only when there's a failure.

One idea is to include the test ID in the string(s) you test for
equality, such that the diagnostics printed by ERT will inherently
include the test ID, and will allow finding the problematic code
easily.  For example, instead of

   "AB<POINT>"

you could use "TEST#1<POINT>" or something along those lines.

Thanks.




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

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


Received: (at 65734) by debbugs.gnu.org; 12 Sep 2023 13:43:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 12 09:43:06 2023
Received: from localhost ([127.0.0.1]:56535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qg3fV-0005KS-Jv
	for submit <at> debbugs.gnu.org; Tue, 12 Sep 2023 09:43:06 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152]:52428)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qg3fR-0005Ju-IQ
 for 65734 <at> debbugs.gnu.org; Tue, 12 Sep 2023 09:43:04 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4RlPsg5sgfz9sWm;
 Tue, 12 Sep 2023 15:42:47 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1694526167;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=0o5418bRf0U97mT3nhyLUDQWH444KHXZmSXd+xn+5Do=;
 b=YlludN0/M4Fug4kmYmC6At9Qev9/oASlsyA4iPbSuSmNVCl1cYtB1eA9n0CF4VuY3E2o4Y
 Gn35u+UAd/FjwQrkqdOkDPwIVPN6t6inYW/nlzVo4zxGhVPIkS2MB2FLHXO+/n+6NMxQ+s
 NgKPYLEwFGt4HeUvkWYijkEv7Q8Ni/MpoCTnS0PzqduCDOEVRwzm6rq0Fpc/DwjQ0YVI1C
 Erq5buwMdIYmFqGbqHIuG0RWMAbDnAx84xPIZlDEnpZGsNqrDLaI2NLfz/yRHpeYFqGDMZ
 fVcfBa3pw+k5Y8i5aZgkMo+LpCpedyqLYdifLSCluJz+aDi2V1J1q7URsnMKmA==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN> <8334zmrmnu.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Tue, 12 Sep 2023 15:04:41 +0200
In-reply-to: <8334zmrmnu.fsf@HIDDEN>
Message-ID: <87il8fbj8q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4RlPsg5sgfz9sWm
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: yantar92@HIDDEN, 65734 <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: -1.7 (-)

> From: Eli Zaretskii <eliz@HIDDEN>
> Date: Sun, 2023-09-10 19:57 +0300
>
>> From: Sebastian Miele <iota@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>, Ihor Radchenko <yantar92@HIDDEN>
>> Date: Sun, 10 Sep 2023 18:31:20 +0200
>> 
>> I removed emacs-orgmode@HIDDEN from CC.
>> 
>> > From: Sebastian Miele <iota@HIDDEN>
>> > Date: Wed, 2023-09-06 15:30 +0200
>> >
>> > I will write the tests.  And I will probably come up with an updated
>> > version of the original patch.  There is at least one cosmetic change.
>> > And something else that I want to have tried.  May take some time.
>> 
>> Please have a look at the following patch.  For now it contains three
>> tests, two of them with :expected-result :failed.  (They do not fail on
>> the bug-fixed version of `kill-whole-line'.)
>
> Yes, there should be more tests, ideally: there are situations where
> kill-whole-line signals an error,

Those tests are on the radar.

> and I don't think I see tests where some of the text is invisible (as
> the function uses forward-visible-line and end-of-visual-line).

That already is covered via (org-mode) and (org-fold-hide-sublevels 1)
in test `kill-whole-line-invisible'.

>> There probably will be more tests and further questions.  But for now, I
>> would like to basically have a statement of whether the style of writing
>> the tests goes in an acceptable direction.
>
> Looks reasonable, but I'm not sure I understand what will the test
> show if one of the tests fails: will the information shown then tell
> enough to understand which of the sub-tests failed and why?

That almost certainly would not be immediately obvious in the current
state.  I have next to no experience in working with testing frameworks.
But I assumed that regressions do not happen that often, and that it
would be good enough if the code of the test can be grasped quickly.
Then, in case of a regression, the test code can be temporarily
sprinkled with some printf-like debugging to find out the exact location
in the test.

However, enough of that printf-like debugging could also be hard-coded,
like in the following definition (see the line ending in the comment
"Provide some context"):

  (ert-deftest kill-whole-line-read-only ()
    ;;:expected-result :failed
    (cl-flet
        ((subtest (kill-whole-line-arg expected-kill-lines expected-buffer-lines)
           (should `(subtest ,kill-whole-line-arg)) ; Provide some context
           (ert-with-test-buffer-selected nil
             (simple-tests--set-buffer-text-point-mark
              (string-join '("-2" "-1" "A<POINT>B" "1" "2" "") "\n"))
             (ert-simulate-command '(read-only-mode 1))
             (should-error (ert-simulate-command
                            `(kill-whole-line ,kill-whole-line-arg))
                           :type 'buffer-read-only)
             (should (equal (string-join expected-kill-lines "\n")
                            (car kill-ring)))
             (should (equal (string-join expected-buffer-lines "\n")
                            (simple-tests--get-buffer-text-point-mark))))))
      (subtest 0 '("AB") '("-2" "-1" "AB<POINT>" "1" "2" ""))
      (subtest 1 '("AB" "") '("-2" "-1" "AB" "<POINT>1" "2" ""))
      (subtest 2 '("AB" "1" "") '("-2" "-1" "AB" "1" "<POINT>2" ""))
      (subtest 3 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
      (subtest 9 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
      (subtest -1 '("" "AB") '("-2" "-1<POINT>" "AB" "1" "2" ""))
      (subtest -2 '("" "-1" "AB") '("-2<POINT>" "-1" "AB" "1" "2" ""))
      (subtest -3 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))
      (subtest -9 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))))

With the always succeeding

  (should `(subtest ,kill-whole-line-arg)) ; Provide some context

at the beginning of ervery subtest, the context would be clear after
pressing l in a buffer showing the ERT test results (but never on the
console).

An alternative would be to use `message'.  That would also provide the
context on the console.  However, that also may be a bit noisy.

Another possibility would be to define every subtest as a top-level
test, by a macro like:

  (defmacro simple-test--define-kill-whole-line-read-only-test (kill-whole-line-arg)
    ...)

But that feels a bit over the top and unflexible.

What to me feels like an ideal solution would be the concept of a
current context during an ERT test.  Just something like a (defvar
ert-current-context) that always initially is dynamically let-bound to
nil during a test.  That could be setq'ed at different locations in a
test to different arbitrary values (somewhat like ERT explanations).
When a should fails, and the ert-current-context is non-nil, ERT would
display the current context as the first information on the failed test.

WDYT?

For now I assume that providing context via

  (should `(subtest ,kill-whole-line-arg)) ; Provide some context

is good enough.




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Sep 2023 16:58:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 10 12:58:18 2023
Received: from localhost ([127.0.0.1]:51183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qfNlJ-00014g-Lf
	for submit <at> debbugs.gnu.org; Sun, 10 Sep 2023 12:58:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38472)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qfNlE-00014M-VA
 for 65734 <at> debbugs.gnu.org; Sun, 10 Sep 2023 12:58:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qfNl4-0000oS-EK; Sun, 10 Sep 2023 12:58:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=YbWoJIePe6RXZHAOS1eeOp0v+q1jH6Dt43ECLdOFtx4=; b=rIp4TjR9T/tx
 Z5By8N/BzjRFAoADM0ubkB6vX5Iwi8FqKXD++BM9uHKOo0y6HV5x7SUYWHM0xBeQ7ROtKIr5i7e/0
 Bym8+ANCW1mfJ/EvHGnd/9Hi5Fyv3ICZjcl+U8nm1yTRuJMsfNoQtuxbOj6uoVLgVFlBeNson+PbN
 QkMhD2flfWRnsKxhVFepGIcbTMJaf6GqlP17vGFzZlFlRSeErHFuj3k0NQ2l79nFgF522uYUPHqDW
 WOBKC32gBbYpGJJXykUTxTnVWTVz00mpVmXtKb+aHvITSf07CN4g5PhpniXJN8mQVbHXqoE0H1NvD
 Ea7JH7hXISdWtTOh2ozK4g==;
Date: Sun, 10 Sep 2023 19:57:41 +0300
Message-Id: <8334zmrmnu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
In-Reply-To: <87zg1u0yrp.fsf@HIDDEN> (message from Sebastian Miele on Sun, 
 10 Sep 2023 18:31:20 +0200)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
 <87zg1u0yrp.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: yantar92@HIDDEN, 65734 <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 (---)

> From: Sebastian Miele <iota@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, Ihor Radchenko <yantar92@HIDDEN>
> Date: Sun, 10 Sep 2023 18:31:20 +0200
> 
> I removed emacs-orgmode@HIDDEN from CC.
> 
> > From: Sebastian Miele <iota@HIDDEN>
> > Date: Wed, 2023-09-06 15:30 +0200
> >
> > I will write the tests.  And I will probably come up with an updated
> > version of the original patch.  There is at least one cosmetic change.
> > And something else that I want to have tried.  May take some time.
> 
> Please have a look at the following patch.  For now it contains three
> tests, two of them with :expected-result :failed.  (They do not fail on
> the bug-fixed version of `kill-whole-line'.)

Yes, there should be more tests, ideally: there are situations where
kill-whole-line signals an error, and I don't think I see tests where
some of the text is invisible (as the function uses
forward-visible-line and end-of-visual-line).

> There probably will be more tests and further questions.  But for now, I
> would like to basically have a statement of whether the style of writing
> the tests goes in an acceptable direction.

Looks reasonable, but I'm not sure I understand what will the test
show if one of the tests fails: will the information shown then tell
enough to understand which of the sub-tests failed and why?

Thanks.




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

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


Received: (at 65734) by debbugs.gnu.org; 10 Sep 2023 16:38:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 10 12:38:38 2023
Received: from localhost ([127.0.0.1]:51173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qfNSH-0000Vs-Ip
	for submit <at> debbugs.gnu.org; Sun, 10 Sep 2023 12:38:38 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152]:52484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qfNSC-0000Va-ES
 for 65734 <at> debbugs.gnu.org; Sun, 10 Sep 2023 12:38:36 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4RkFs81zFnz9sSs;
 Sun, 10 Sep 2023 18:38:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1694363900;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=Jx/Q54lAMlQqUaijOmeotsXwXaPnZSb6yBKxWstt4R4=;
 b=PslZeeIa851q7GkZT+Da3ctAqiM2DtmH89Xv9Y3Pp343U69tqYhKt8fUzrkZ76o/0FQqK+
 RhaFhJD1F23nEcQViTCRbjyCh8A8J8BwgB5VAYBIHSWXzSZr4s3Ra8aX1+l2t8yvDUXkdy
 kFP0EP47PA3M8o6bcdKw7z/ZtOicKeffTyXQ1QVj7FZNXY0gGPZ4RX9PDMHzUwwhLF3JA5
 ihJKhxpVmyZIzuXn1QaCRkKVXdQNnwQx+io0QaPbONhXQKAC9L1ViM/nqAMljBDu/8rI2a
 rYgFQHmfiX4LE2+OFUBZd5BPeLiXB10SjhiOMoneMkm7a6Je0CRl0kwC2YpLVA==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: 65734 <at> debbugs.gnu.org
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Sun, 10 Sep 2023 18:31:20 +0200
In-reply-to: <87tts78lve.fsf@HIDDEN>
Message-ID: <87zg1u0yrp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4RkFs81zFnz9sSs
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: Eli Zaretskii <eliz@HIDDEN>, Ihor Radchenko <yantar92@HIDDEN>
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: -1.7 (-)

I removed emacs-orgmode@HIDDEN from CC.

> From: Sebastian Miele <iota@HIDDEN>
> Date: Wed, 2023-09-06 15:30 +0200
>
> I will write the tests.  And I will probably come up with an updated
> version of the original patch.  There is at least one cosmetic change.
> And something else that I want to have tried.  May take some time.

Please have a look at the following patch.  For now it contains three
tests, two of them with :expected-result :failed.  (They do not fail on
the bug-fixed version of `kill-whole-line'.)

There probably will be more tests and further questions.  But for now, I
would like to basically have a statement of whether the style of writing
the tests goes in an acceptable direction.

diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 28d8120f143..c15b0059536 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -22,6 +22,7 @@
 ;;; Code:
 
 (require 'ert)
+(require 'ert-x)
 (eval-when-compile (require 'cl-lib))
 
 (defun simple-test--buffer-substrings ()
@@ -40,6 +41,112 @@ simple-test--dummy-buffer
      ,@body
      (with-no-warnings (simple-test--buffer-substrings))))
 
+(defconst simple-tests-point-tag "<POINT>")
+(defconst simple-tests-mark-tag "<MARK>")
+
+(defun simple-tests--set-buffer-text-point-mark (description)
+  "Set the current buffers text, point and mark according to DESCRIPTION.
+
+Erase current buffer and insert DESCRIPTION.  Set point to the
+first occurrence of `simple-tests-point-tag' (\"<POINT>\") in the
+buffer, removing it.  If there is no `simple-tests-point-tag',
+set point to the beginning of the buffer.  Similar for the active
+mark (`simple-tests-mark-tag', \"<MARK>\")."
+  (erase-buffer)
+  (insert description)
+  (goto-char (point-min))
+  (when (search-forward simple-tests-mark-tag nil t)
+    (delete-char (- (length simple-tests-mark-tag)))
+    (push-mark (point) nil 'activate))
+  (goto-char (point-min))
+  (when (search-forward simple-tests-point-tag nil t)
+    (delete-char (- (length simple-tests-point-tag)))))
+
+(defun simple-tests--get-buffer-text-point-mark ()
+  "Inverse of `simple-tests--set-buffer-text-point-mark'."
+  (if (not mark-active)
+      (concat (buffer-substring-no-properties (point-min) (point))
+              simple-tests-point-tag
+              (buffer-substring-no-properties (point) (point-max)))
+    (if (< (mark) (point))
+        (concat (buffer-substring-no-properties (point-min) (mark))
+                simple-tests-mark-tag
+                (buffer-substring-no-properties (mark) (point))
+                simple-tests-point-tag
+                (buffer-substring-no-properties (point) (point-max)))
+      (concat (buffer-substring-no-properties (point-min) (point))
+              simple-tests-point-tag
+              (buffer-substring-no-properties (point) (mark))
+              simple-tests-mark-tag
+              (buffer-substring-no-properties (mark) (point-max))))))
+
+(ert-deftest simple-tests--buffer-text-point-mark-helpers ()
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "")
+    (should (equal "" (buffer-substring-no-properties
+                       (point-min) (point-max))))
+    (should-not mark-active)
+    (should (equal 1 (point)))
+    (should (equal "<POINT>" (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "<POINT><MARK>")
+    (should (equal "" (buffer-substring-no-properties
+                       (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 1 (point)))
+    (should (equal 1 (mark)))
+    (should (equal "<POINT><MARK>" (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "<MARK><POINT>")
+    (should (equal "" (buffer-substring-no-properties
+                       (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 1 (point)))
+    (should (equal 1 (mark)))
+    (should (equal "<POINT><MARK>" (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "A<POINT><MARK>B")
+    (should (equal "AB" (buffer-substring-no-properties
+                         (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 2 (point)))
+    (should (equal 2 (mark)))
+    (should (equal "A<POINT><MARK>B"
+                   (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "A<MARK><POINT>B")
+    (should (equal "AB" (buffer-substring-no-properties
+                         (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 2 (point)))
+    (should (equal 2 (mark)))
+    (should (equal "A<POINT><MARK>B"
+                   (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "A<POINT>X<MARK>B")
+    (should (equal "AXB" (buffer-substring-no-properties
+                          (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 2 (point)))
+    (should (equal 3 (mark)))
+    (should (equal "A<POINT>X<MARK>B"
+                   (simple-tests--get-buffer-text-point-mark))))
+
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "A<MARK>X<POINT>B")
+    (should (equal "AXB" (buffer-substring-no-properties
+                          (point-min) (point-max))))
+    (should mark-active)
+    (should (equal 3 (point)))
+    (should (equal 2 (mark)))
+    (should (equal "A<MARK>X<POINT>B"
+                   (simple-tests--get-buffer-text-point-mark)))))
+
 
 ;;; `count-words'
 (ert-deftest simple-test-count-words-bug-41761 ()
@@ -1046,5 +1153,109 @@ simple-tests-zap-to-char
     (with-zap-to-char-test "abcdeCXYZ" "XYZ"
       (zap-to-char 1 ?C 'interactive))))
 
+
+;;; Tests for `kill-whole-line'
+
+(ert-deftest kill-whole-line-invisible ()
+  :expected-result :failed
+  (cl-macrolet ((test (kill-whole-line-arg &rest expected-lines)
+                  `(ert-with-test-buffer-selected nil
+                     (simple-tests--set-buffer-text-point-mark
+                      (string-join
+                       '("* -2" "hidden"
+                         "* -1" "hidden"
+                         "* A<POINT>B" "hidden"
+                         "* 1" "hidden"
+                         "* 2" "hidden"
+                         "")
+                       "\n"))
+                     (ert-simulate-command '(org-mode))
+                     (ert-simulate-command '(org-fold-hide-sublevels 1))
+                     (ert-simulate-command
+                      '(kill-whole-line ,kill-whole-line-arg))
+                     (should
+                      (equal (string-join ',expected-lines "\n")
+                             (simple-tests--get-buffer-text-point-mark))))))
+    (test 0
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test 1
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test 2
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>* 2" "hidden"
+          "")
+    (test 3
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>")
+    (test 9
+          "* -2" "hidden"
+          "* -1" "hidden"
+          "<POINT>")
+    (test -1
+          "* -2" "hidden"
+          "* -1" "hidden<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -2
+          "* -2" "hidden<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -3
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")
+    (test -9
+          "<POINT>"
+          "* 1" "hidden"
+          "* 2" "hidden"
+          "")))
+
+(ert-deftest kill-whole-line-read-only ()
+  :expected-result :failed
+  (cl-macrolet
+      ((test (kill-whole-line-arg expected-kill-lines expected-buffer-lines)
+         `(ert-with-test-buffer-selected nil
+            (simple-tests--set-buffer-text-point-mark
+             (string-join '("-2" "-1" "A<POINT>B" "1" "2" "") "\n"))
+            (ert-simulate-command '(read-only-mode 1))
+            (should-error (ert-simulate-command
+                           '(kill-whole-line ,kill-whole-line-arg)))
+            (should (equal (string-join ,expected-kill-lines "\n")
+                           (car kill-ring)))
+            (should (equal (string-join ,expected-buffer-lines "\n")
+                           (simple-tests--get-buffer-text-point-mark))))))
+    (test 0 '("AB") '("-2" "-1" "AB<POINT>" "1" "2" ""))
+    (test 1 '("AB" "") '("-2" "-1" "AB" "<POINT>1" "2" ""))
+    (test 2 '("AB" "1" "") '("-2" "-1" "AB" "1" "<POINT>2" ""))
+    (test 3 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
+    (test 9 '("AB" "1" "2" "") '("-2" "-1" "AB" "1" "2" "<POINT>"))
+    (test -1 '("" "AB") '("-2" "-1<POINT>" "AB" "1" "2" ""))
+    (test -2 '("" "-1" "AB") '("-2<POINT>" "-1" "AB" "1" "2" ""))
+    (test -3 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))
+    (test -9 '("-2" "-1" "AB") '("<POINT>-2" "-1" "AB" "1" "2" ""))))
+
+(ert-deftest kill-whole-line-after-other-kill ()
+  (ert-with-test-buffer-selected nil
+    (simple-tests--set-buffer-text-point-mark "A<POINT>X<MARK>B")
+    (ert-simulate-command '(kill-region (mark) (point) 'region))
+    (ert-simulate-command '(kill-whole-line))
+    (should (equal "AXB" (car kill-ring)))
+    (should (equal "<POINT>"
+                   (simple-tests--get-buffer-text-point-mark)))))
+
 (provide 'simple-test)
 ;;; simple-tests.el ends here




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 13:48:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 09:48:45 2023
Received: from localhost ([127.0.0.1]:38930 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeFNE-0007bA-WF
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:48:45 -0400
Received: from mout01.posteo.de ([185.67.36.65]:33911)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qeFNC-0007al-SS
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:48:44 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 1D47D24002D
 for <65734 <at> debbugs.gnu.org>; Thu,  7 Sep 2023 15:48:34 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1694094515; bh=2DuDpPAP18Tx7j/juxU52WWx5EvP5IRAU1AgQTZ2ne0=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=O1G8RyzOQF8hx9v/By+wJLMNT8jTSeSPrfk9u89D4i8moKIGdmAzXr5Oom3wT3llz
 dlgUK8vBmUhxv/kZc3EYgKp5MGjAbHz2rs+zCbaz7ihLOburdVULxIFXtyebI9iFYQ
 KNFmIW7CmLPK5MwNo5c2dJCe4aNvrF7lFwFCsT+HVmbmtFxzVhevNKbGuIjwDxDLGv
 R9Balt/+WyGF4eZhfjvsAdo/J7AoTjbn8tJFPZSNO0pRGQJyRIZxxXGOv8bI+04WC7
 f7PHkx42nzmq4ykMazye4vz17hi/h3TdkqfsjoaJLLmdyzBQ82oZczfEvSphBSmu1E
 N40pNbCcQdopQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RhLDf2H24z6twh;
 Thu,  7 Sep 2023 15:48:34 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87tts78lve.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN> <87tts78lve.fsf@HIDDEN>
Date: Thu, 07 Sep 2023 13:49:24 +0000
Message-ID: <875y4mnlej.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <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 (---)

Sebastian Miele <iota@HIDDEN> writes:

>>> Then, what should we do to move things forward? I guess the first step
>>> will be writing these missing tests.
>>
>> Yes, that'd be most welcome.
>
> I will write the tests.  And I will probably come up with an updated
> version of the original patch.  There is at least one cosmetic change.
> And something else that I want to have tried.  May take some time.

Thanks in advance!
Feel free to ask us anything if you need any help.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 13:43:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 09:43:17 2023
Received: from localhost ([127.0.0.1]:38916 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeFHx-0007Ni-50
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:43:17 -0400
Received: from mout02.posteo.de ([185.67.36.66]:53333)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qeFHu-0007NS-U6
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:43:16 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 3B82F240107
 for <65734 <at> debbugs.gnu.org>; Thu,  7 Sep 2023 15:43:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1694094187; bh=nLcyAH+MhlSPMDErdSkmEFNznBNe1Jdfd9zb77UFkPE=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=cgumHZokZwa1VqOG3cpGupJqfEkjoceloPq/7aDXNtK6XIomfO5R9yuPnKdHb+grh
 IeXUO0BTFNcXRxYQqLo23Zy+2whx8EWqbzajFsmP9I9oRxTITLetqrachQkFK61TOH
 nExwn7BPZlCFIPlkgKByucDEDXWXjMrXZHwwi1xpoCFb2scyjgntZF7p9oXEWgJn6c
 tmttrWFzD7ZEJ8E0jUXfcdIqgE5fhkI8xE6gnTB+Ld9qIUv/5v3sd+t2quiUYREKRp
 80o0XtF654JYrzWEfsCh1UdgGAAPR9fxvjZVlo3qdrwK2H6GT/DEXMiWLfsG2Aqqo+
 Td7qrg0c919cw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RhL6L3TQbz9rxG;
 Thu,  7 Sep 2023 15:43:06 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83il8mz3nf.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
 <837cp3333w.fsf@HIDDEN> <87pm2upajy.fsf@localhost>
 <83il8mz3nf.fsf@HIDDEN>
Date: Thu, 07 Sep 2023 13:43:57 +0000
Message-ID: <878r9inlnm.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> We may have a misunderstanding here.
>> In "* Heading text :tag1:tag2:", everything is visible yet Org needs to
>> protect ":tag1:tag2: from being killed by `kill-line', but not from
>> `kill-whole-line'. Moreover, the behaviour also depends on the point
>> position - if point is inside ":tag1:tag2:", we fall back to the default
>> behaviour. And the whole "special" behaviour can also be switched off by
>> flipping `org-special-ctrl-k'.
>> 
>> Invisibility has nothing to do with this need.
>
> Isn't it true that invisibility is what causes the user expectations
> in this case to begin with?  Then saying that "invisibility has
> nothing to do with this" is not really accurate, is it?

There are two things I raised in the previous messages:
1. The specific bug reported, related to invisibility changes in
   after-change-functions
2. A request to extend `kill-whole-line' and `kill-line' to cater Org
   needs:
   - for invisible text in folded headings
   - for visible text, when `kill-line' is called on a heading

In this branch of the discussion, I am describing a request to deal with
visible text.

Hope I made things more clear now.

>> >> What about something like `end-of-visible-line-function'?
>> >
>> > That is also a possibility, but it will then affect kill-line
>> > _anywhere_ in the buffer, whereas a text property can have a more
>> > localized effect.  Are you sure kill-line will need this customization
>> > on the whole buffer?
>> 
>> Applying text property is not free - (1) we need to do it across the
>> whole buffer, which scales poorly; (2) we need to keep it updated as the
>> buffer changes, which scales even worse. In addition, adding more text
>> properties slow down redisplay, which Org already strains to its limits.
>
> I understand, but in my book correctness tramps performance, and I was
> trying to make the point that perhaps modifying the behavior of
> kill-line everywhere in Org buffers might be incorrect for some cases.

I think that `end-of-visible-line-function' might be more appropriate -
it does not reduce correctness (we can simply fall back to the default
behaviour when needed) and less problematic performance-wise, as I
described.

Or maybe some other idea. But not text properties - they are
problematic performance-wise. In addition, `org-kill-line' is sensitive
to point position (do different things at bol, before ":tag:...", and
inside it). I am not sure how to make things depend on point position
with text properties only.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 10:31:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 06:31:14 2023
Received: from localhost ([127.0.0.1]:38712 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeCI6-0005i3-BN
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:31:14 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171]:41478)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qeCI2-0005ho-Cr
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:31:13 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4RhFrh3XzGz9syC;
 Thu,  7 Sep 2023 12:31:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1694082660;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=OnZ4eYl0gvnhrygdcU3W4OVmFE57Pn4AlGYRPaVn+Vc=;
 b=jXXn0dZQcQGP6PIp67PK1NFCu0s9t2Cu8fiI0LbE9UFSsuooY2vwFoScsnMFRaF65shewC
 27edGviewIEb4GjZonSOIeIqgUmwUCiHVd8fo4oGvmc28q7GiAsLmVJ3noyE7qPOR25nmM
 3N0IpTAv4GQ7uegxKBwYkeVboTCfWQCBhdyWPD/splLzGw7RTWmPQiSaQS+RgzQC+v+aKV
 DsNzX4IA+g0552agKlU3dLwukj0WRfhsC5eR+KFCXD6mzL6BCCRq8u75q+4splk702Lgyz
 lziAEJSlOtv2fp0AEIFMqGuH6YtEkYO4sILyBz1wP2iuT2csyjGRDDlOIK1RTA==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
 <837cp3333w.fsf@HIDDEN> <87pm2upajy.fsf@localhost>
 <83il8mz3nf.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Thu, 07 Sep 2023 12:27:28 +0200
In-reply-to: <83il8mz3nf.fsf@HIDDEN>
Message-ID: <87edja1di5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Rspamd-Queue-Id: 4RhFrh3XzGz9syC
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Ihor Radchenko <yantar92@HIDDEN>,
 65734 <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: -1.7 (-)

> From: Eli Zaretskii <eliz@HIDDEN>
> Date: Thu, 2023-09-07 13:19 +0300
>
>> From: Ihor Radchenko <yantar92@HIDDEN>
>> Cc: iota@HIDDEN, 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
>> Date: Thu, 07 Sep 2023 10:00:49 +0000
>>=20
>> Eli Zaretskii <eliz@HIDDEN> writes:
>>=20
>> > Then perhaps just a special value for buffer-invisibility-spec, or
>> > some other simple variation of a property Org already uses?
>>=20
>> We may have a misunderstanding here.
>> In "* Heading text :tag1:tag2:", everything is visible yet Org needs to
>> protect ":tag1:tag2: from being killed by `kill-line', but not from
>> `kill-whole-line'. Moreover, the behaviour also depends on the point
>> position - if point is inside ":tag1:tag2:", we fall back to the default
>> behaviour. And the whole "special" behaviour can also be switched off by
>> flipping `org-special-ctrl-k'.
>>=20
>> Invisibility has nothing to do with this need.
>
> Isn't it true that invisibility is what causes the user expectations
> in this case to begin with?  Then saying that "invisibility has
> nothing to do with this" is not really accurate, is it?

I am not 100=C2=A0% sure what exactly the misunderstanding is.  My first
guess would be: You assume that the tags are invisible, too.  But that
is not the case.  Because of that the special handling of tags by
`org-kill-line' has nothing to do with visibility.




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 10:20:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 06:20:26 2023
Received: from localhost ([127.0.0.1]:38681 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeC7c-0005HA-93
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:20:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qeC7M-0005Gc-Ll
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:20:23 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qeC7E-0007vR-IH; Thu, 07 Sep 2023 06:20:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=wk+dCVtdvorLfd5DfGTe+YAQBn567+qXNgnYuLvUg3Q=; b=lJNjmgthrITF
 tTFV9GiqAmt9LXnfyATnHpN0bxTVaIe/2iZ5p+RDKNZ8dQ5fZbRuSiSmRSTwxt4zQBqXb0JfV+zZd
 QINRUho3Tn7lwyvXrmwoRJyBpo4NvXSwUjhST2WFuM0s1SrW0fRmE5+rYukWhTvO4hV6POHq2al6Z
 RdCcZ2oPh1ZatuHXB/W5k0IZrQ4R8SHnhqNcO8cmtDPD1E6Kp2fJE5z6hGQQ79NnfVt+wfMCMEBoa
 CgJTtz5Cx+tNd+qe5ckFrDowTkzyZAwu8YtpLxuzGnho/N2aJo2LIH0GF+0lIPvtGSMFW8g3882Ej
 hjJvtzv0Zffp7xgKuOBMZw==;
Date: Thu, 07 Sep 2023 13:19:48 +0300
Message-Id: <83il8mz3nf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87pm2upajy.fsf@localhost> (message from Ihor Radchenko on Thu,
 07 Sep 2023 10:00:49 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
 <837cp3333w.fsf@HIDDEN> <87pm2upajy.fsf@localhost>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: iota@HIDDEN, 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
> Date: Thu, 07 Sep 2023 10:00:49 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Then perhaps just a special value for buffer-invisibility-spec, or
> > some other simple variation of a property Org already uses?
> 
> We may have a misunderstanding here.
> In "* Heading text :tag1:tag2:", everything is visible yet Org needs to
> protect ":tag1:tag2: from being killed by `kill-line', but not from
> `kill-whole-line'. Moreover, the behaviour also depends on the point
> position - if point is inside ":tag1:tag2:", we fall back to the default
> behaviour. And the whole "special" behaviour can also be switched off by
> flipping `org-special-ctrl-k'.
> 
> Invisibility has nothing to do with this need.

Isn't it true that invisibility is what causes the user expectations
in this case to begin with?  Then saying that "invisibility has
nothing to do with this" is not really accurate, is it?

> >> What about something like `end-of-visible-line-function'?
> >
> > That is also a possibility, but it will then affect kill-line
> > _anywhere_ in the buffer, whereas a text property can have a more
> > localized effect.  Are you sure kill-line will need this customization
> > on the whole buffer?
> 
> Applying text property is not free - (1) we need to do it across the
> whole buffer, which scales poorly; (2) we need to keep it updated as the
> buffer changes, which scales even worse. In addition, adding more text
> properties slow down redisplay, which Org already strains to its limits.

I understand, but in my book correctness tramps performance, and I was
trying to make the point that perhaps modifying the behavior of
kill-line everywhere in Org buffers might be incorrect for some cases.




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 10:02:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 06:02:43 2023
Received: from localhost ([127.0.0.1]:38666 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeBqV-0004pe-2V
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:02:43 -0400
Received: from mout01.posteo.de ([185.67.36.65]:52027)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qeBqR-0004pN-Ro
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:02:41 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 9B572240029
 for <65734 <at> debbugs.gnu.org>; Thu,  7 Sep 2023 12:02:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1694080952; bh=5c4riDdXtJ/eWnH1Zw2iVhDHUW8iG3+2X0iAPq6EGDI=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=l4zDsWOs6dT/Z7qajUYg6g22RUX8J38gnxbg9bDAaPjFqtJ02q/lqjGLv9NwfqFj6
 bkqnWOVZwth7M3mNifsu1+iszCkM6VwDB7IQqtV+cbwYOTiomvn2hS13wn/dU8mjLI
 pvSTitEvQkkAhpy4p22cN4dfA/XcxZlSVhpIzWO50axgs6/bB/GR5sQLwSZxOwSpsB
 gS8SZ8TiAbP6JM3Su/kzN8VqiGUmTdBjmv/CRwh9oVSsJGB1gKORgv+PFj9k4hy2pO
 SsmUq/rBMjUDfuOENmcTbjP7gXcfYsvDIzZH62G3Xv3+WEZYUHB2a+Z2TO9aRUb5PN
 UHKQVzpZinj5A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RhFCr1Mgzz6tsb;
 Thu,  7 Sep 2023 12:02:32 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87o7if72b2.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
 <87o7if72b2.fsf@HIDDEN>
Date: Thu, 07 Sep 2023 10:03:22 +0000
Message-ID: <87msxypafp.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <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 (---)

Sebastian Miele <iota@HIDDEN> writes:

>> I think there is misunderstanding. `combine-after-change-calls' will not
>> affect the two-step modification of the kill ring, if we put it around
>> `kill-whole-line'. Or do I miss something?
>
> I tried to wrap the problematic portion of `kill-whole-line' into
> `combine-after-change-calls'.  It seems to have no effect.  The
> after-change function `org-fold-core--fix-folded-region' still gets
> called twice, not fixing the bug.  I did not dig deeper, because the
> stuff that makes `combine-after-change-calls' work at least partially
> goes in C and seems to be scattered over several places.

Oops. Of course, I meant `combine-change-calls'.
`combine-after-change-calls' does not always have effect. In particular,
Org sets `before-change-functions' effectively disabling the macro you tried.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 7 Sep 2023 10:00:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 06:00:11 2023
Received: from localhost ([127.0.0.1]:38661 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeBo3-0004lF-Bu
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:00:11 -0400
Received: from mout01.posteo.de ([185.67.36.65]:44037)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qeBnz-0004iu-63
 for 65734 <at> debbugs.gnu.org; Thu, 07 Sep 2023 06:00:10 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 7EA4C240028
 for <65734 <at> debbugs.gnu.org>; Thu,  7 Sep 2023 11:59:59 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1694080799; bh=pDBywziPeDpCyUSqOC29KuXs9vFTktph2IkJ+AG+lZU=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ozw1ZSp/zJv+P5D5yFx02oyI3sfIogXTNahYFAE3Rlz+wM8unKEgJfX3faGv1zJYd
 8FgZ4/DXbafxwR1wunlE+GdR2vbaAk4u6IHooRb4GjF5mOXE2QcalZRpquO/n1s2IM
 vH47BuJ+nLKi6DpuLtRjsk3tTG5dM4SUGmxrdzg5RlSA7r08ZDGnNL6VyOH0bfWwlw
 B9z/dsL4yTXlvtMLh8mRE8EAFjAqufzcBPOjzaBA2xv3u5Cyb0Nvpt7sE+bCqliwvS
 cL9lYSpSBJCjrPon1kmk9TMc1qFzR9N2WaNrD3NGky0y0gm25kYKzzjD5+ZOB5HqPZ
 HGRB5U9gQBHXQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RhF8t5nVCz6tsg;
 Thu,  7 Sep 2023 11:59:58 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <837cp3333w.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
 <837cp3333w.fsf@HIDDEN>
Date: Thu, 07 Sep 2023 10:00:49 +0000
Message-ID: <87pm2upajy.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> >> In addition, `org-kill-line' acts specially in certain scenarios:
>> >> 
>> >> For
>> >> * Heading <point> text :tag1:tag2:
>> >> 
>> >> `org-kill-line' will keep and re-align ":tag1:tag2:":
>> >> 
>> >> * Heading <point>      :tag1:tag2:
>> >> 
>> >> It would be nice if we could express such behavior without overriding
>> >> the `kill-line' command.
>> ...
>> I am not sure if I like the idea of text property - marking all the tags
>> in buffer with text property is expensive.
>
> Then perhaps just a special value for buffer-invisibility-spec, or
> some other simple variation of a property Org already uses?

We may have a misunderstanding here.
In "* Heading text :tag1:tag2:", everything is visible yet Org needs to
protect ":tag1:tag2: from being killed by `kill-line', but not from
`kill-whole-line'. Moreover, the behaviour also depends on the point
position - if point is inside ":tag1:tag2:", we fall back to the default
behaviour. And the whole "special" behaviour can also be switched off by
flipping `org-special-ctrl-k'.

Invisibility has nothing to do with this need.

>> What about something like `end-of-visible-line-function'?
>
> That is also a possibility, but it will then affect kill-line
> _anywhere_ in the buffer, whereas a text property can have a more
> localized effect.  Are you sure kill-line will need this customization
> on the whole buffer?

Applying text property is not free - (1) we need to do it across the
whole buffer, which scales poorly; (2) we need to keep it updated as the
buffer changes, which scales even worse. In addition, adding more text
properties slow down redisplay, which Org already strains to its limits.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 15:24:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 11:24:19 2023
Received: from localhost ([127.0.0.1]:37148 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qduOA-0002GO-IH
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 11:24:18 -0400
Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]:54278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qduO5-0002G5-MD
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 11:24:16 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4RgmPG4WtMz9t54;
 Wed,  6 Sep 2023 17:24:02 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1694013842;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=g1FS0cah8DcgdC/jtJ5wlSNgG9WLP6BowAm+srTWYPY=;
 b=W5xNxQMVhgROEP3VeiIiQfv2h5wxs9LkM1C5LRxiNMIf4TvAZVpi7itz5PwX2qJYpCYJ/g
 GsXxj9Wi7PNSbFQ38Lf46pTrcLkJSZx7R+3z4N6fy6ZPJo51XhKrbWrlHWC6sO08i1Wjjo
 imoW7HuKSzS107hkeLVJIStNxwoSEU4agi5Fi737nTTUvj+tVK+6loFAtXd8vXa9aPlGjR
 BW0A+ldASm/8rhlEnyid/9jJDxC0sPDQH/lYg5h3WJ14dAQSzaQ26GcG8jAVsDRItDwuLQ
 4HzHcN8DTtut7RdFL7m80a/mrShsnYLM4naw48azpfhs0/50j23SaunZqSA/pg==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
From: Sebastian Miele <iota@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Wed, 06 Sep 2023 17:04:48 +0200
In-reply-to: <87ledju2j7.fsf@localhost>
Message-ID: <87o7if72b2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 65734 <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: -1.7 (-)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Wed, 2023-09-06 08:30 +0000
>
> Eli Zaretskii <eliz@HIDDEN> writes:
>
>>> It would also make sense to group the two edits together via
>>> `combine-after-change-calls', although a more universal way to know that
>>> certain edits are a part of the same known command (even when called
>>> non-interactively) would be useful.
>>
>> The command kills in two parts for a good reason, which is explained
>> in the comments to the code.  So making a single group will not work,
>> I think, at least not in all situations.
>
> I think there is misunderstanding. `combine-after-change-calls' will not
> affect the two-step modification of the kill ring, if we put it around
> `kill-whole-line'. Or do I miss something?

I tried to wrap the problematic portion of `kill-whole-line' into
`combine-after-change-calls'.  It seems to have no effect.  The
after-change function `org-fold-core--fix-folded-region' still gets
called twice, not fixing the bug.  I did not dig deeper, because the
stuff that makes `combine-after-change-calls' work at least partially
goes in C and seems to be scattered over several places.

The Emacs Lisp manual states that `combine-after-change-calls' "arranges
to call the after-change functions just once for a series of several
changes=E2=80=94if that seems safe."  So this case does not seem safe.  Apa=
rt
from that, there is no stated guarantee for when it would seem it safe.

I conclude that, although this path looked possibly elegant at first,
and I wanted to give it a try, this cannot work out.




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 13:36:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 09:36:19 2023
Received: from localhost ([127.0.0.1]:33430 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdshf-0001UW-Cf
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 09:36:19 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:42044)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qdshb-0001UG-R4
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 09:36:17 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Rgk0k5SYdz9t6j;
 Wed,  6 Sep 2023 15:36:06 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1694007366;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=QWCRWsroHAZv+o/GtvY3T35tINIM3e1gBg0+gACmBgk=;
 b=wX1ZJ9sQMVqnnSIfmQBPp3a8RJyGff7QBby6NXjFmatHs0DtP42KivAgVUlOzbf599G1e4
 TI4qo/6oym8rZxRB/Kd6dtDrg0ubtpiatyK5bgpN56086hVVeVqDsrX1ml7VYvlt7VJ6y0
 RahIBaRGQJkrnO6cGJ9wm+H8s6jP9QpVTr3Od5yYAZ0H3XdFUeqy1XtADHWwicmhQJfppf
 xbYFHWlVS0X9UwUZVzcMxy64AZdzjijp2ri4nTOY+iHWO5J0j9qRRDR9jhWftsd/J7aBzs
 NEmvCWJcdW3hNap7PqecP7N+jbV/NjDO5wvRXEK/Yvif1N363i0LcokppezKsw==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
 <838r9j339x.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Wed, 06 Sep 2023 15:30:16 +0200
In-reply-to: <838r9j339x.fsf@HIDDEN>
Message-ID: <87tts78lve.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Ihor Radchenko <yantar92@HIDDEN>,
 65734 <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: -1.7 (-)

> From: Eli Zaretskii <eliz@HIDDEN>
> Date: Wed, 2023-09-06 15:16 +0300
>
>> From: Ihor Radchenko <yantar92@HIDDEN>
>> Date: Wed, 06 Sep 2023 08:23:23 +0000
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> The following would do it.  I think I tested it rather thoroughly.
>> >> During testing I found another bug that is addressed by the let-binding
>> >> of kill-read-only-ok during the first kill-region below.
>> >
>> > Thanks.  Sadly, we don't have any tests for this function in our test
>> > suite, so verifying this non-trivial change will not be easy...
>> 
>> Then, what should we do to move things forward? I guess the first step
>> will be writing these missing tests.
>
> Yes, that'd be most welcome.

I will write the tests.  And I will probably come up with an updated
version of the original patch.  There is at least one cosmetic change.
And something else that I want to have tried.  May take some time.

>> Anything else?
>
> How about asking on emacs-devel that people who use kill-whole-line
> frequently install the patch and run with it for some time?  (We could
> do that after installing the changes on master, of course.)




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 12:20:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 08:20:43 2023
Received: from localhost ([127.0.0.1]:33326 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdrWV-0007y7-5W
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 08:20:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48370)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdrWR-0007xr-6d
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 08:20:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdrWK-000258-BD; Wed, 06 Sep 2023 08:20:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=iwCg2S+NTMzWg5DtD5wjH10ZNUrRV8TLD8QRUli2ckg=; b=BaKQd27o28sD
 8bWwL/rTqd3OUT8TcZ3NznVQAY2ecMGckd9PUPdnUwdtoyxkJB+PoGOChP1c0d8axYQYXuJ8NK/0Q
 KKDykseoOhv+j5fLifkcuMjBAEAhu+8nnXC5FUGVSeinsV+bERlwms+0FjFwZc8WQquXTOQDsSOQt
 iUv3reJX3YX8Afr4zJpFEBU3AhKxHHDuzf3/z2ZrqQjdcq+Z4mf9UPbjOIA+EjoARUlB5mViW1ZNV
 SpS4MuFrDO/RMsS8Lgvt5mwJkMI2ouOnVBtmUfaf6oda08xAJQc4WrsdnYmjJZUGgWgzszOqNE+kz
 KUlCDKLjcnMENkWSU9wYUA==;
Date: Wed, 06 Sep 2023 15:20:19 +0300
Message-Id: <837cp3333w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87ledju2j7.fsf@localhost> (message from Ihor Radchenko on Wed,
 06 Sep 2023 08:30:36 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <87ledju2j7.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: iota@HIDDEN, 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
> Date: Wed, 06 Sep 2023 08:30:36 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> In addition, `org-kill-line' acts specially in certain scenarios:
> >> 
> >> For
> >> * Heading <point> text :tag1:tag2:
> >> 
> >> `org-kill-line' will keep and re-align ":tag1:tag2:":
> >> 
> >> * Heading <point>      :tag1:tag2:
> >> 
> >> It would be nice if we could express such behavior without overriding
> >> the `kill-line' command.
> >
> > This could be handled by a suitable extension to end-of-visible-line.
> > For example, introduce a new text property which end-of-visible-line
> > would then handle the same as it currently handles invisible text.
> 
> I am not sure if I like the idea of text property - marking all the tags
> in buffer with text property is expensive.

Then perhaps just a special value for buffer-invisibility-spec, or
some other simple variation of a property Org already uses?

> What about something like `end-of-visible-line-function'?

That is also a possibility, but it will then affect kill-line
_anywhere_ in the buffer, whereas a text property can have a more
localized effect.  Are you sure kill-line will need this customization
on the whole buffer?




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 12:17:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 08:17:07 2023
Received: from localhost ([127.0.0.1]:33301 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdrT1-0007ru-GX
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 08:17:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdrT0-0007rN-5K
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 08:17:06 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdrSs-0001Jt-S2; Wed, 06 Sep 2023 08:16:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=2r/MHYvEoAcx8cl5F0CXtpxhb8IKB6MFP1BKJ3bSCqI=; b=m8k0wpwXo0fw
 FuHRfMmZ9oz0Q0eeID6Quj3uJibCUNHzqk038y+69wDxhOcmgnhWOwzF3Sp3fTdV+2RfCSn4aHkAx
 PzGcSPWNdVg7GLmu6v0xCDeMotxscHUQlx0EZpVoU5AAeoXZdZ9LWY/M3Hk4WXSWBBQGm6dWjruJG
 BCHf3Be0MEHg3yDCZlfk52m9m1XWCjAiBFPy4rDlDq/ImnEXf12lD2iNAxjGF8OPfQJPw6kKJxoFD
 eVBcJPJpVc9KfoA6aiIxxhIOrOPabxp/0sTA+f29Ch6rEdEmnvjZsEPgkqRV98U4FJkaV6bReS8se
 AsKfvmPwz017XViJ9VyENQ==;
Date: Wed, 06 Sep 2023 15:16:42 +0300
Message-Id: <838r9j339x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87o7ifu2v8.fsf@localhost> (message from Ihor Radchenko on Wed,
 06 Sep 2023 08:23:23 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN> <87o7ifu2v8.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Sebastian Miele <iota@HIDDEN>, 65734 <at> debbugs.gnu.org,
>  emacs-orgmode@HIDDEN
> Date: Wed, 06 Sep 2023 08:23:23 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> The following would do it.  I think I tested it rather thoroughly.
> >> During testing I found another bug that is addressed by the let-binding
> >> of kill-read-only-ok during the first kill-region below.
> >
> > Thanks.  Sadly, we don't have any tests for this function in our test
> > suite, so verifying this non-trivial change will not be easy...
> 
> Then, what should we do to move things forward? I guess the first step
> will be writing these missing tests.

Yes, that'd be most welcome.

> Anything else?

How about asking on emacs-devel that people who use kill-whole-line
frequently install the patch and run with it for some time?  (We could
do that after installing the changes on master, of course.)




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 08:29:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 04:29:55 2023
Received: from localhost ([127.0.0.1]:60753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdnv9-0004nt-GH
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 04:29:55 -0400
Received: from mout01.posteo.de ([185.67.36.65]:54681)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qdnv6-0004nf-Gi
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 04:29:54 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id E15AF240028
 for <65734 <at> debbugs.gnu.org>; Wed,  6 Sep 2023 10:29:45 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1693988985; bh=p5OcqwWSVZV3xyQtHDBgwpktUY+5M1SqLnsTCvK1uG8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=XGg8ANTuxbYaTUEfTr7D8D1mP0FFunqZbQTkVZMY3fxxy7SrPByTIbKYCC5w17AcR
 e2zG1G7jyx5uJHJpZn5OCRomjVsgmkOFczhoAxeMBIQMi9guhgI9SKKL7EHuLrcvU8
 M01Y8pLbAblQKLFKFXt0qOFCFXAE2mG9aaUrK/+S2DANGqdDdIYN0c6ckqiKOWN7s2
 9AIJu/D5iaUl1B5y2QupIcJLPxkpPzYt/cbvlQenTgASBHlxRRZNVX5vhqpXjSFTt9
 o5NAreKil/fFzAYIvnuoXcsdKYqAJS7iTFrPsywQ+9/d8BXlS1KcHNS86MtnV7dAVz
 dWtH7ryLSnEcw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RgbCF2vhmz9rxS;
 Wed,  6 Sep 2023 10:29:45 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83h6o84yz1.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN>
Date: Wed, 06 Sep 2023 08:30:36 +0000
Message-ID: <87ledju2j7.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> It would also make sense to group the two edits together via
>> `combine-after-change-calls', although a more universal way to know that
>> certain edits are a part of the same known command (even when called
>> non-interactively) would be useful.
>
> The command kills in two parts for a good reason, which is explained
> in the comments to the code.  So making a single group will not work,
> I think, at least not in all situations.

I think there is misunderstanding. `combine-after-change-calls' will not
affect the two-step modification of the kill ring, if we put it around
`kill-whole-line'. Or do I miss something?

> ...  And relying on after-change
> hooks to fix this use case sounds too obscure and fragile to me.

Indeed. I did not talk about this particular bug report. What I meant is
some way to group change hooks executed by the same function/command.

>> In addition, `org-kill-line' acts specially in certain scenarios:
>> 
>> For
>> * Heading <point> text :tag1:tag2:
>> 
>> `org-kill-line' will keep and re-align ":tag1:tag2:":
>> 
>> * Heading <point>      :tag1:tag2:
>> 
>> It would be nice if we could express such behavior without overriding
>> the `kill-line' command.
>
> This could be handled by a suitable extension to end-of-visible-line.
> For example, introduce a new text property which end-of-visible-line
> would then handle the same as it currently handles invisible text.

I am not sure if I like the idea of text property - marking all the tags
in buffer with text property is expensive. What about something like
`end-of-visible-line-function'?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 6 Sep 2023 08:23:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 06 04:22:59 2023
Received: from localhost ([127.0.0.1]:60747 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdnoC-0004dd-PQ
	for submit <at> debbugs.gnu.org; Wed, 06 Sep 2023 04:22:59 -0400
Received: from mout02.posteo.de ([185.67.36.66]:37361)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qdno7-0004dM-AJ
 for 65734 <at> debbugs.gnu.org; Wed, 06 Sep 2023 04:22:43 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id B4590240105
 for <65734 <at> debbugs.gnu.org>; Wed,  6 Sep 2023 10:22:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1693988552; bh=tHw/QHQTV/1nsg2eehA9HZiLQW3Y9ilPfe8+j+E++m8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=qrclMUZUHNgcq7AmNvAlboEK9HBecAUGJzM2dtRuDSsjS0gEEog+RGWEp+y+1kV8i
 +M98+I61eMCSzGhaGbriVITdoX6CQ/7+xyCb1obKUlcTHgJyYpv18wvYEkMjSq+nlR
 P5uGj5rzUc97SfmNlBoJX4Q+mYwH12ioCh4dDXl5SUXWUxWqR0SsB8ZYIE1T0Mzo+i
 SZ8F0CXztpmOHlZ3qgICXuQbyZSsgGBVIPFPKyqD50kFgBOWVbKnemHC0JqAvXdZMl
 fW7QYPinKwThMI6/xx8DUMp4KzudsgwDHpiKk6mMQNWgwabUvyr7+rgZ/aZ5a3x2eR
 0sY9VEpt/PiPw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Rgb2w1Rc1z9rxT;
 Wed,  6 Sep 2023 10:22:32 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83bkeg4o1u.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
 <83bkeg4o1u.fsf@HIDDEN>
Date: Wed, 06 Sep 2023 08:23:23 +0000
Message-ID: <87o7ifu2v8.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN,
 Sebastian Miele <iota@HIDDEN>
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: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> The following would do it.  I think I tested it rather thoroughly.
>> During testing I found another bug that is addressed by the let-binding
>> of kill-read-only-ok during the first kill-region below.
>
> Thanks.  Sadly, we don't have any tests for this function in our test
> suite, so verifying this non-trivial change will not be easy...

Then, what should we do to move things forward? I guess the first step
will be writing these missing tests. Anything else?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 16:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 12:15:40 2023
Received: from localhost ([127.0.0.1]:58177 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYiG-0004Fl-Oi
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:15:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdYiD-0003vl-OK
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:15:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdYi7-0004UY-B3; Tue, 05 Sep 2023 12:15:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=8t69r5ZtsIsegXAqF4gtdOQ7VrH/8FpEodsoqqL8kZw=; b=nIFOwWhJOGRC
 IjMoeRpAa/YzkmkSZVl+myEbonwalgiAca9oWw+ISNZ+UNBa6BtfUXu2shM/QRv67y19kx+FgIYYS
 CLLxF1PJsyTacM/DVuYgQoMEBvdkaSckrqVcQ/Qktx8FmPnp2k9YyGizIl6ezs6C5ktduThX1vvgt
 FsfjXD4mHVJFeWOO0F5tRtw8+0A8VuHxeYReGIKXj3DV96TUPwBGa2ShFS97sB1Re9MRh1jdsOzKq
 gWTdLS6nyZxL+k+daGKgl5+6I1H2EW/CRfXN8IX11yT15DD6GQNaLwJzuP1eToHJGS9T6/G1x8MQ7
 VdaEx6R11JYfLjD0DaLXYA==;
Date: Tue, 05 Sep 2023 19:14:55 +0300
Message-Id: <83a5u04mww.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <875y4ovct9.fsf@localhost> (message from Ihor Radchenko on Tue,
 05 Sep 2023 15:50:58 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, manikulin@HIDDEN, emacs-orgmode@HIDDEN,
 iota@HIDDEN
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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Max Nikulin <manikulin@HIDDEN>, iota@HIDDEN,
>  65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
> Date: Tue, 05 Sep 2023 15:50:58 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> On 05/09/2023 17:29, Ihor Radchenko wrote:
> >> > Confirmed.
> >> 
> >> It is a regression in comparison to e.g. org-mode-9.3.1.
> >
> > What changed since org-mode-9.3.1?  Was it some change in Emacs, and
> > if so, which one?
> 
> The reported bug is a side effect of a feature when Org automatically
> reveals hidden outlines that are "broken" due to edits and thus could
> not be unfolded easily. For example, when destroying parent heading in a
> folding subtree:
> 
> <point>* Heading...
> 
>    |
>    V
> 
>  Heading
> <unfolded>
> 
> The feature was introduced in Or 9.5.

Understood, thanks.




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 16:11:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 12:11:35 2023
Received: from localhost ([127.0.0.1]:58162 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYeN-0002QG-5A
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:11:35 -0400
Received: from mout02.posteo.de ([185.67.36.66]:41597)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qdYeK-0002Q2-Ma
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:11:33 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id EEF4F240106
 for <65734 <at> debbugs.gnu.org>; Tue,  5 Sep 2023 18:11:25 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1693930286; bh=7C6/wjyNsm0gpqwFxd9JGOrycaE15QsII5Blzpe0WVQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ST9EHgo8WMWg8ZwlmDO9Vh6cB6zcKohzc9n5/t01FAiEn+yvIfVVw4UmCGxOILBcg
 46cg5UOacAhnciE9mPE7DhU5p0sd6PTJIe59heQGXKNrN2WDLnh8atGvEB/ohQzx1V
 gnNk9xUnTCnuX5Tx1y19mZ4I6FjP/2raLfE9SEJnvOuKe+Ihf6l6kpZXF0SyyfVN56
 wcDfPIbGd9QEfhowRe/gnuWp3FWz+6Fk1R5PN1AFFJim/yStxy8vBklHWT86CX9ZXa
 i2N2mwFmZMu0dqEOtIwTLlcpMNAtXFHDzWOrQRC3e8q3q2XlRIbhZP/5vGTXairfLc
 9WhKhEs3QoCqg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Rg9VP24pKz9rxB;
 Tue,  5 Sep 2023 18:11:25 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Max Nikulin <manikulin@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87b854c6-f3c1-49ea-be4c-64c99644b47b@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost>
 <87b854c6-f3c1-49ea-be4c-64c99644b47b@HIDDEN>
Date: Tue, 05 Sep 2023 16:12:17 +0000
Message-ID: <87zg20tx9a.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, emacs-orgmode@HIDDEN,
 iota@HIDDEN
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 (---)

Max Nikulin <manikulin@HIDDEN> writes:

>> The feature was introduced in Or 9.5.
>
> Or in 9.6?

Oops. Yup. Org 9.6 - the latest release. Together with org-fold library.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 16:02:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 12:02:43 2023
Received: from localhost ([127.0.0.1]:58062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYVm-00027e-SD
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:02:43 -0400
Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:48540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manikulin@HIDDEN>) id 1qdYVj-00027O-3l
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 12:02:41 -0400
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2bceb02fd2bso40137991fa.1
 for <65734 <at> debbugs.gnu.org>; Tue, 05 Sep 2023 09:02:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1693929752; x=1694534552; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :references:cc:to:content-language:subject:user-agent:mime-version
 :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=q+hc7Oqkr0+bZUiUV0QXHe8TJebC865N7DolS0g45bI=;
 b=KCLw7t24rjzEguM1yfekDJZuVmBjHeMKfobGFjZl+yvCnuc0h8D/z+LPgtO+Wz/H+g
 ymbiJXvY7h3l0tFSl4ZkPf9vpq6Cul7yYFW2hQcLYVTrMCSMmVVgVyalXktJ4rKYw6NT
 jFNHOA0oZJWuTpeD834mrpGrIu7bUmj/wpKYQF9dnJgdn/w/Os+ne1nvCJqpEE8A8XGE
 NIUz31/XedpkfVyBVavzVhtSxDqG4QYG9zXWrz3vF7PR6S3RTVdy+nWIr1mYlY+aH7sU
 rMcRDMmw/A5xYGSpeYZjUjFFBBxGXa1d8T0+9IRNVGZuXUcINiXhF6YyZdGC5wwuJvzv
 EMLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1693929752; x=1694534552;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :references:cc:to:content-language:subject:user-agent:mime-version
 :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=q+hc7Oqkr0+bZUiUV0QXHe8TJebC865N7DolS0g45bI=;
 b=LCQVCJ2svIMIG1QfvS8+rscHdFVrAqB0z08Mmz/VxkfZ7C3m/9c/OYjENdG9yV22Ji
 WoWUqbphkGgc3wWaDbqdTudliDb5CUMOQ7DJATVX/kbuwMyl1qG5mHw7nD2IQKbn7Jan
 KABB3bjzXLrSDGcddTbQOIg2Y8PCMUVx2DRK6CvCSX1BfVLfX2y4XpVT8NQqY4lJAh25
 8qzO7gMvntg5rWWIn8W1S7Rdlb4ocIJQrcEFVoysyJjx243AzQ5YwSDozcMe4Qg8zdaH
 pbSRrKlaMi+Q0aDPZWZmlPlruX0e85J0fmDS4RRkNoQ2DWOz4kVDGsXGz1y7PXNN632r
 PYmw==
X-Gm-Message-State: AOJu0YwX0RP9FJ9A+RAcx/gafQrXO3R+bl2DpVsFZJKBhQ3FY0FHv//x
 WfL/tuCheLtteY1HoGwPtWs=
X-Google-Smtp-Source: AGHT+IEAJKoz2MfcSyFqW47wWBG6Hbyyl8M1dKUvUbh/97nT4PgDdlAcRm7FWXxmY+HhdGA9RlspfQ==
X-Received: by 2002:a2e:988e:0:b0:2bc:b29e:8fef with SMTP id
 b14-20020a2e988e000000b002bcb29e8fefmr147777ljj.34.1693929752330; 
 Tue, 05 Sep 2023 09:02:32 -0700 (PDT)
Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188])
 by smtp.googlemail.com with ESMTPSA id
 m19-20020a2eb6d3000000b002bcda31af0fsm2989967ljo.74.2023.09.05.09.02.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 05 Sep 2023 09:02:31 -0700 (PDT)
Message-ID: <87b854c6-f3c1-49ea-be4c-64c99644b47b@HIDDEN>
Date: Tue, 5 Sep 2023 23:02:30 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Content-Language: en-US, ru-RU
To: Ihor Radchenko <yantar92@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
 <875y4ovct9.fsf@localhost>
From: Max Nikulin <manikulin@HIDDEN>
Mail-Followup-To: Ihor Radchenko <yantar92@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, iota@HIDDEN, 65734 <at> debbugs.gnu.org,
 emacs-orgmode@HIDDEN
In-Reply-To: <875y4ovct9.fsf@localhost>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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.5 (--)

On 05/09/2023 22:50, Ihor Radchenko wrote:
> Eli Zaretskii writes:
> 
>>> On 05/09/2023 17:29, Ihor Radchenko wrote:
>>>> Confirmed.
>>>
>>> It is a regression in comparison to e.g. org-mode-9.3.1.
>>
>> What changed since org-mode-9.3.1?  Was it some change in Emacs, and
>> if so, which one?

That was a comparison on emacs-26.3

> The reported bug is a side effect of a feature when Org automatically
> reveals hidden outlines that are "broken" due to edits and thus could
> not be unfolded easily. For example, when destroying parent heading in a
> folding subtree:
> 
> <point>* Heading...
> 
>     |
>     V
> 
>   Heading
> <unfolded>
> 
> The feature was introduced in Or 9.5.

Or in 9.6? On Emacs-28.2 I have compared Org-9.5.5 and 9.6.8. Unfolding 
on removing of a heading marker does not work in 9.5.5, but collapsed 
list items and headers are removed correctly.




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 15:50:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 11:50:46 2023
Received: from localhost ([127.0.0.1]:57953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYKD-0001k2-U6
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:50:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdYKC-0001jo-D3
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:50:45 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdYK6-0007ts-4F; Tue, 05 Sep 2023 11:50:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=N0kLEyybNzBoOT6f1HizXRMXMyNUMVNxXw84DfS9O70=; b=QOKEMBYtYludeFCJjXt4
 aZA844BqXVtHWbv2SAp9HOagcgkLw7GdYdw0i65ycjqQ3FdSzwo8zNAzq4EwALB/vO6ZjURG5Fcru
 vpi6ddEYX2nMknIknNJ0unhiRVjEtCvldsB2ZxnpLhDeFlTZFoLxjg2KYnTtResJ5hYkayeiIKy8n
 JB6jQtNylPIxvMisxPVNb/HrH4UaEDtGSY0KV5HATE7Ba9tu7BdudJqGEQ87rp5Dza+BBxpG3atQD
 Hap0JW4x35/ZrAsuJhkQ8k46hjnoLYX+SVkkng7eVyH1oGkFsLrW7nwxLYZX29DmJQgb6UGWTZiPW
 iVZGMlhRs3ftHA==;
Date: Tue, 05 Sep 2023 18:50:21 +0300
Message-Id: <83bkeg4o1u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
In-Reply-To: <875y4oaban.fsf@HIDDEN> (message from Sebastian Miele on Tue, 
 05 Sep 2023 17:25:38 +0200)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN> <875y4oaban.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, yantar92@HIDDEN, 65734 <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 (---)

> From: Sebastian Miele <iota@HIDDEN>
> Cc: Ihor Radchenko <yantar92@HIDDEN>, 65734 <at> debbugs.gnu.org,
>  emacs-orgmode@HIDDEN
> Date: Tue, 05 Sep 2023 17:25:38 +0200
> 
> > From: Eli Zaretskii <eliz@HIDDEN>
> > Date: Tue, 2023-09-05 14:54 +0300
> >
> > […]
> >
> > So we could decide that this command needs to become smarter when the
> > visual line includes invisible text.  That is, improve the command
> > without making any Org-specific changes anywhere.  Patches to that
> > effect are welcome.
> 
> The following would do it.  I think I tested it rather thoroughly.
> During testing I found another bug that is addressed by the let-binding
> of kill-read-only-ok during the first kill-region below.

Thanks.  Sadly, we don't have any tests for this function in our test
suite, so verifying this non-trivial change will not be easy...




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 15:50:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 11:50:22 2023
Received: from localhost ([127.0.0.1]:57949 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYJq-0001jQ-GA
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:50:22 -0400
Received: from mout01.posteo.de ([185.67.36.65]:37639)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qdYJn-0001j4-T1
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:50:21 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 55EA8240027
 for <65734 <at> debbugs.gnu.org>; Tue,  5 Sep 2023 17:50:13 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1693929013; bh=IgEn2mix6wSjfGijs59CBPhdWuE1C7MOeMuGAQZ9CmM=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ZuHbYaI6fbhfSHh1MJY93bDYx7Avtp39Isyni48cku5ItYTPAgc1Yq6O2asxLTg1V
 jJv/lty/xI58BEU8eNO0Eoy/nFLMr7os6+L4NIdV7WIbwoHj3aMxkfUmDtC7ddtDY5
 0lSd+X1fuPOF9fdYWh4cgiC2wKMo62GTuEbAD/pNKbITRd0BJ6+2C4pW6bN4YuIMZI
 kxyvrPfDZLRS3wlYCoQkzqHciEZKGEVy0p6QteTNOZsRsS856D91gEi2D+u9bTBf+f
 Rv+qCcfeai9U+XZHrIO1pZS9Gfg64F7oyU5eo/Jo1+rpYbtPY/hKy/IfpBLcL4wpna
 HMapwG3E/U8mw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Rg91w3SWyz6tx8;
 Tue,  5 Sep 2023 17:50:12 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <83cyyw4of7.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> <83cyyw4of7.fsf@HIDDEN>
Date: Tue, 05 Sep 2023 15:50:58 +0000
Message-ID: <875y4ovct9.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, Max Nikulin <manikulin@HIDDEN>,
 emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> On 05/09/2023 17:29, Ihor Radchenko wrote:
>> > Confirmed.
>> 
>> It is a regression in comparison to e.g. org-mode-9.3.1.
>
> What changed since org-mode-9.3.1?  Was it some change in Emacs, and
> if so, which one?

The reported bug is a side effect of a feature when Org automatically
reveals hidden outlines that are "broken" due to edits and thus could
not be unfolded easily. For example, when destroying parent heading in a
folding subtree:

<point>* Heading...

   |
   V

 Heading
<unfolded>

The feature was introduced in Or 9.5.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 15:42:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 11:42:48 2023
Received: from localhost ([127.0.0.1]:57932 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdYCW-0001SK-3A
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:42:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55742)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdYCS-0001S7-Tp
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:42:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdYCK-0006Kf-RM; Tue, 05 Sep 2023 11:42:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=eeUWn05Aq5jCSbOeID0OIm8FeS3Y8ntVe/WhohwtDyc=; b=pyn45Lmmsz0q
 dIOma9CCwd0Mns82NK+E8WXtlA0QINCELrd48cn9fsODxGS9JlUuVWCqjyz4acfK12Hrq0bRyrOpB
 nsmSU2hrYEltVNuJT7FR5Kc8SeE8PkkElLCkGcBIjryXnNzKAShMFaWeOVLGiCU0NsfOlWSezbcc0
 4PjhDhF90PSCv1AqfVIKnEJFq6XDkpOCL4KSZh/YDgB5kMeCQj7BESuidfCsTbaBM7zC1kC0CoGCB
 3temXQ8S1UWnPVjUrdAftAs8CduSFnCt3IMxE/A4AonSCrtXFzsS9UY+XEz3gcRf0urLvxBSHDfy6
 iFMkyDxxykwBRNkbmjUooQ==;
Date: Tue, 05 Sep 2023 18:42:20 +0300
Message-Id: <83cyyw4of7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Max Nikulin <manikulin@HIDDEN>
In-Reply-To: <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN> (message from
 Max Nikulin on Tue, 5 Sep 2023 21:30:58 +0700)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, yantar92@HIDDEN, emacs-orgmode@HIDDEN,
 iota@HIDDEN
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 (---)

> Cc: emacs-orgmode@HIDDEN, 65734 <at> debbugs.gnu.org
> Date: Tue, 5 Sep 2023 21:30:58 +0700
> From: Max Nikulin <manikulin@HIDDEN>
> 
> On 05/09/2023 17:29, Ihor Radchenko wrote:
> > Confirmed.
> 
> It is a regression in comparison to e.g. org-mode-9.3.1.

What changed since org-mode-9.3.1?  Was it some change in Emacs, and
if so, which one?




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 15:29:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 11:29:34 2023
Received: from localhost ([127.0.0.1]:57865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdXzh-00016e-Pm
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:29:34 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:47606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qdXze-00016O-Kc
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 11:29:32 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Rg8Yt0yqDz9stN;
 Tue,  5 Sep 2023 17:29:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1693927762;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=PdzbzfHlgAiYE+ZGtYfrys6pTDruDOBScby9SOL7ny8=;
 b=n7Muq1EFr6mFICfJ8vozmj9tYqrRKzjiZEp5XSowdCOkIayvpW/1R70LeUUYr7DdekuGIP
 3FfUWyXrtq1+CnuX1d+Ema6AIxcgDWDx3KArnuiQpVTdGPoMAyNZn37HP02adloh0yz0PX
 a4qG+i1YdaodYZ4ikkiHi+GmWBfIzJ808SwYtyJvoZvYzr8JrR3qmRq6HFGCaGOU0z5QZf
 ruhDDQ2AaAo7gAffQAfxdixyHahxTlYB/krZuD1ydeqnWGoknDBqyIqCrMlBpsOlO79BLX
 zu8tWWMC1bOlN+MpDmYZsv1W9PTA5yCssOOqmYFk34hI06vsQ7fFmM4kEJUvgg==
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
 <83h6o84yz1.fsf@HIDDEN>
From: Sebastian Miele <iota@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
Date: Tue, 05 Sep 2023 17:25:38 +0200
In-reply-to: <83h6o84yz1.fsf@HIDDEN>
Message-ID: <875y4oaban.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, Ihor Radchenko <yantar92@HIDDEN>,
 65734 <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: -1.7 (-)

> From: Eli Zaretskii <eliz@HIDDEN>
> Date: Tue, 2023-09-05 14:54 +0300
>
> [=E2=80=A6]
>
> So we could decide that this command needs to become smarter when the
> visual line includes invisible text.  That is, improve the command
> without making any Org-specific changes anywhere.  Patches to that
> effect are welcome.

The following would do it.  I think I tested it rather thoroughly.
During testing I found another bug that is addressed by the let-binding
of kill-read-only-ok during the first kill-region below.

diff --git a/lisp/simple.el b/lisp/simple.el
index abd587245fe..d983cb85ab3 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6631,28 +6631,50 @@ kill-whole-line
   (unless (eq last-command 'kill-region)
     (kill-new "")
     (setq last-command 'kill-region))
-  (cond ((zerop arg)
-	 ;; We need to kill in two steps, because the previous command
-	 ;; could have been a kill command, in which case the text
-	 ;; before point needs to be prepended to the current kill
-	 ;; ring entry and the text after point appended.  Also, we
-	 ;; need to use save-excursion to avoid copying the same text
-	 ;; twice to the kill ring in read-only buffers.
-	 (save-excursion
-	   (kill-region (point) (progn (forward-visible-line 0) (point))))
-	 (kill-region (point) (progn (end-of-visible-line) (point))))
-	((< arg 0)
-	 (save-excursion
-	   (kill-region (point) (progn (end-of-visible-line) (point))))
-	 (kill-region (point)
-		      (progn (forward-visible-line (1+ arg))
-			     (unless (bobp) (backward-char))
-			     (point))))
-	(t
-	 (save-excursion
-	   (kill-region (point) (progn (forward-visible-line 0) (point))))
-	 (kill-region (point)
-		      (progn (forward-visible-line arg) (point))))))
+  ;; - We need to kill in two steps, because the previous command
+  ;;   could have been a kill command, in which case the text before
+  ;;   point needs to be prepended to the current kill ring entry and
+  ;;   the text after point appended.
+  ;; - We need to be careful to avoid copying text twice to the kill
+  ;;   ring in read-only buffers.
+  ;; - We need to determine the boundaries of visible lines before we
+  ;;   do the first kill, because that may change visibility
+  ;;   (bug#65734).
+  (let ((regions-begin (point-marker))
+        region1-end)
+    (cond ((zerop arg)
+           (setq region1-end (save-excursion
+                               (forward-visible-line 0)
+                               (point-marker)))
+           (end-of-visible-line))
+	  ((< arg 0)
+	   (setq region1-end (save-excursion
+                               (end-of-visible-line)
+                               (point-marker)))
+           (forward-visible-line (1+ arg))
+	   (unless (bobp) (backward-char)))
+	  (t
+	   (setq region1-end (save-excursion
+                               (forward-visible-line 0)
+                               (point-marker)))
+	   (progn (forward-visible-line arg))))
+    ;; - Pass the marker positions and not the markers themselves.
+    ;;   kill-region determines whether to prepend or append to a
+    ;;   previous kill by checking the direction of the region.  But
+    ;;   it deletes the content and hence moves the markers before
+    ;;   that.  That effectively makes every region delimited by
+    ;;   markers an (empty) forward region.
+    ;; - Make the first kill-region emit a non-local exit only if the
+    ;;   second kill-region below would not operate on a non-empty
+    ;;   region.
+    (let ((kill-read-only-ok (or kill-read-only-ok
+                                 (/=3D regions-begin (point)))))
+      (kill-region (marker-position regions-begin)
+                   (marker-position region1-end)))
+    (kill-region (marker-position regions-begin)
+                 (point))
+    (set-marker regions-begin nil)
+    (set-marker region1-end nil)))
=20
 (defun forward-visible-line (arg)
   "Move forward by ARG lines, ignoring currently invisible newlines only.




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 14:31:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 10:31:14 2023
Received: from localhost ([127.0.0.1]:57518 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdX5F-0002SH-Ue
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 10:31:14 -0400
Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:56494)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <manikulin@HIDDEN>) id 1qdX59-0002Ry-9p
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 10:31:13 -0400
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2bcfdadd149so43762421fa.0
 for <65734 <at> debbugs.gnu.org>; Tue, 05 Sep 2023 07:31:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1693924261; x=1694529061; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :content-language:references:cc:to:subject:user-agent:mime-version
 :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=f9SzSruMZN14vOrUTo9X3u+ZTXlMyYaRIrSlGRbVJOI=;
 b=Z7ZmcmamitcL4uXoHmVrss2TqnypMFuvc2lqgtmyXYXs34SnVy1n30SEbDbxTfibBp
 3lc4TFw2An2UapnlKvsrVJqENVggVmRfnvFPGncp0pWXv7cJgoNBmzAt/kWr4nTZWU/0
 BH8KsxPGUCuB+gH+YISxMPI68m95zzrySo31PLdqUOCsRcbo3vYWpSk9sCi7WvJzbu3h
 S8PcLjYCpZygo3/1iSeW+8PN9oNXNEJ+Uks+dlxYLilaMFwRxeYzvDUHZaGk4yhxxBGw
 T54nXCIfBxEjRGJ+Lb5nQlaATsnwEOBmfClk1xZL3B6Yn4FTZiCneR2GbPtfF5v1OdBw
 dMOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1693924261; x=1694529061;
 h=content-transfer-encoding:in-reply-to:mail-followup-to:from
 :content-language:references:cc:to:subject:user-agent:mime-version
 :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=f9SzSruMZN14vOrUTo9X3u+ZTXlMyYaRIrSlGRbVJOI=;
 b=c4vDcvKh7gvvOjgndFvOzTsIiJ528YCIwSZsym1KZ93t0V/1l5SVBnGZ5w8ZByJZG9
 wd4ZUU5QFlSKuHEcUBwoterqgm6puUJQEd/yYsPtnX9fx+b0j5fJDDD4DIQ8JPcDA9Xi
 lHHkv1k0MX91mFuB4XJnJdi5cxoRm/6VzrneUo0XGEOXkEG6vp0UGpgKur0MMoOrRCVe
 HXFQ8na1i0y2waVoyru8exjOd58Ojf3svGn59c4CwdPJ6TWHCtrt0LcRes9b+c/BZOS7
 tohdGGVd8NdmBkX66ggaitYflhDtxoNNQasfG4Fqu47syjmbXasZxA6WCbfvbGI1wY00
 6r+g==
X-Gm-Message-State: AOJu0YzOS2LrfvLom6DnkXW/G7/nWrBA3MsqIMrTXZ20mGlXc0eM2Rbc
 YB732tYiU11zvZCximTLTe8=
X-Google-Smtp-Source: AGHT+IE+nQ8Y9pZTTpJWw1hNDyN+6VyROjjJqWC2zJXipXnh9hp6qJ2Xlhmxkis2Kn292UmL1xCVpw==
X-Received: by 2002:a2e:8955:0:b0:2b9:e53f:e201 with SMTP id
 b21-20020a2e8955000000b002b9e53fe201mr9623694ljk.31.1693924260626; 
 Tue, 05 Sep 2023 07:31:00 -0700 (PDT)
Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188])
 by smtp.googlemail.com with ESMTPSA id
 v10-20020a2e7a0a000000b002bcd2653872sm2965896ljc.30.2023.09.05.07.30.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 05 Sep 2023 07:31:00 -0700 (PDT)
Message-ID: <ce55662a-190f-f719-8383-fa53ce808191@HIDDEN>
Date: Tue, 5 Sep 2023 21:30:58 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
To: Ihor Radchenko <yantar92@HIDDEN>, Sebastian Miele <iota@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
Content-Language: en-US, ru-RU
From: Max Nikulin <manikulin@HIDDEN>
Mail-Followup-To: Ihor Radchenko <yantar92@HIDDEN>,
 Sebastian Miele <iota@HIDDEN>, 65734 <at> debbugs.gnu.org,
 emacs-orgmode@HIDDEN
In-Reply-To: <87tts8vrpb.fsf@localhost>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 65734
Cc: emacs-orgmode@HIDDEN, 65734 <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: -2.5 (--)

On 05/09/2023 17:29, Ihor Radchenko wrote:
> Confirmed.

It is a regression in comparison to e.g. org-mode-9.3.1.

I noticed it for multiline plain list items

- ab
   cd

Only first line is removed by C-S-<backspace> when the item is folded by 
TAB.

For headings I usually use C-c C-x C-w, so I had less chance to face 
this issue.





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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 11:54:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 07:54:54 2023
Received: from localhost ([127.0.0.1]:54597 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdUdx-0006cp-GV
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 07:54:54 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdUdu-0006ca-R4
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 07:54:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdUdo-0002OK-UX; Tue, 05 Sep 2023 07:54:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ctXI1vAgVua1DQvvuF/IvtUNvDeBYd0bzAqagmg8kgQ=; b=cSthk9Eh5b53
 iSbCjSEWtiXN5OSY3SYkBZ/R86opoBABFT3sIsAOjLCbcda+jnlhjP+AU378IL+HjyeVAHDwTqiMD
 3/EpYYiiQSBLqmnLAba1nRgCAhs09fHlCnitJSF4b1N13ydA8yPjn6Ohxd3rPRV1iofM/cm6DGbM5
 fEVxo8b7cdP2L74ZxifupgBVfPCSp0y3+Btp32CWsXZRl7DgwzHVZe/sVpF5BMBVrlDg9ClcvxWFu
 Lxs6qmwqOMh0AHSlIMag4jycwW41ao/AFCeFEZfBexdPD0iYeP0/HAOwkjmWCVCeFvA47C37xD/6X
 6jwAi526Vjn2SXltcbeJkQ==;
Date: Tue, 05 Sep 2023 14:54:26 +0300
Message-Id: <83h6o84yz1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87tts8vrpb.fsf@localhost> (message from Ihor Radchenko on Tue,
 05 Sep 2023 10:29:20 +0000)
Subject: Re: bug#65734: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
References: <87il8pao4l.fsf@HIDDEN> <87tts8vrpb.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN, iota@HIDDEN
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 (---)

> Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Tue, 05 Sep 2023 10:29:20 +0000
> 
> As I described in the above, Org needs more control over the behaviour of
> `kill-line'/`kill-whole-line' when the visible line contains multiple
> lines of hidden text - to protect accidental deletions.
> A hook, where Org can intervene with a yes/no prompt, would be useful.
> It would also make sense to group the two edits together via
> `combine-after-change-calls', although a more universal way to know that
> certain edits are a part of the same known command (even when called
> non-interactively) would be useful.

The command kills in two parts for a good reason, which is explained
in the comments to the code.  So making a single group will not work,
I think, at least not in all situations.  And relying on after-change
hooks to fix this use case sounds too obscure and fragile to me.

Moreover, I don't think this is specific to Org: any mode that folds
or hides portions of text might hit the same problem.

So we could decide that this command needs to become smarter when the
visual line includes invisible text.  That is, improve the command
without making any Org-specific changes anywhere.  Patches to that
effect are welcome.

> In addition, `org-kill-line' acts specially in certain scenarios:
> 
> For
> * Heading <point> text :tag1:tag2:
> 
> `org-kill-line' will keep and re-align ":tag1:tag2:":
> 
> * Heading <point>      :tag1:tag2:
> 
> It would be nice if we could express such behavior without overriding
> the `kill-line' command.

This could be handled by a suitable extension to end-of-visible-line.
For example, introduce a new text property which end-of-visible-line
would then handle the same as it currently handles invisible text.




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

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


Received: (at 65734) by debbugs.gnu.org; 5 Sep 2023 10:28:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 06:28:42 2023
Received: from localhost ([127.0.0.1]:54125 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdTIY-0007Li-77
	for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 06:28:42 -0400
Received: from mout01.posteo.de ([185.67.36.65]:45905)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qdTIU-0007LT-Pj
 for 65734 <at> debbugs.gnu.org; Tue, 05 Sep 2023 06:28:40 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 5DFA3240027
 for <65734 <at> debbugs.gnu.org>; Tue,  5 Sep 2023 12:28:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1693909712; bh=8Ah3fNK74InKWYUdXrhkbtS79qxkX3g3JM3vIBnS/tQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=fvr6vd3OsTvPJ0dPiGV8RusGR2Gaao9z9eETXKgginJAZLQj/ciXYGAb3cK/uiSSs
 /AIbhawcdEupgnp31UB8JyJdzYklo6FeTG2kho6+VYm4qv93v4yTLGHbhEU5o9fQt3
 WTnGM4BeHsGVkDViXXXdX2HSqwrHZVwkcwl0KBz6koalkhrr9sdCghio2/1xjUlt1W
 uK6AM3z+rFnkFez2ED8rUM8Hrp61jikPWAc0fgWgIxpQ/BcX0TnB6a9Dgc+/ceZLYF
 aNkakYq2RAAveRcTNTjKrAjcZDr7DtRKD3TB7KE54k5s99i9HQTK2Sm0RM3I9ugR29
 IYmDgs8JjfGnw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Rg1tl2WVnz6trs;
 Tue,  5 Sep 2023 12:28:31 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
Subject: Re: [BUG] kill-whole-line on folded subtrees [9.6.8
 (release_9.6.8-3-g21171d @ /home/w/usr/emacs/0/29/0/lisp/org/)]
In-Reply-To: <87il8pao4l.fsf@HIDDEN>
References: <87il8pao4l.fsf@HIDDEN>
Date: Tue, 05 Sep 2023 10:29:20 +0000
Message-ID: <87tts8vrpb.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <at> debbugs.gnu.org, emacs-orgmode@HIDDEN
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 (---)

Sebastian Miele <iota@HIDDEN> writes:

> I first reported this to bug-gnu-emacs@HIDDEN (see
> https://debbugs.gnu.org/65734).  However, Eli asks:
>
>> I'm not sure I understand why this is deemed a problem in Emacs.
>> Shouldn't Org redefine C-S-<backspace> if the default binding doesn't
>> suit what happens in Org buffers?  Did you discuss this with Org
>> developers?

Confirmed.

I am CCing debbugs as I'd like to clarify things to be in sync with
Emacs.


> In an emacs -Q, create an Org buffer with the following contents:
>
> --8<---------------cut here---------------start------------->8---
> * AB
> ** C
> --8<---------------cut here---------------end--------------->8---

This will produce

* AB...

> Fold the subtree under the heading AB, so that only a single line is
> displayed (ending in "...").  With point between A and B, hit
> C-S-<backspace> (kill-whole-line).
>
> Expected: The whole _visible_ line, i.e., the entire contents of the
> buffer is erased.  Actual behavior: The line with heading C remains.

This indeed happens because `kill-whole-line' deletes the line in two
steps: "* A" and then the rest.

The first deletion leaves

B<begin invisible>
** C<end invisible>

which drastically alters the outline structure and triggers or to
automatically unfold the subtree, leaving

B
** C

visible.
Then, `kill-whole-line' proceeds with the second part of the deletion
and deletes the now visible line, leading to the observed behaviour.

The first deletion would be an equivalent of deleting "(defun"

(defun foo ()...

in outline-mode and would make it hard to unfold the body, if such
single deletion where performed.

In Org mode, because of frequent user requests about accidental
deletions of hidden text, we try our best to protect deletions of
invisible folded outlines. Automatic unfolding is one of the ways to
attract user's attention to potential accidental edit.

> Contrast this with the same experiment, except that the point is at the
> beginning of the line containing AB when hitting C-S-<backspace>.  Then
> the expected behavior happens.  According to the source of
> kill-whole-line, the intended effect indeed is to kill a whole _visible_
> line.

Currently, Org mode, similar to Eli's suggestion re-binds `kill-line' to
Org's own version - `org-kill-line'. But not `kill-whole-line'.

We can certainly do the same for `kill-whole-line', but in our previous
discussion https://yhetil.org/emacs-devel/87tu8rq2l6.fsf@localhost/, you
asked to consider extending the built-in Emacs commands instead of
overriding them.

As I described in the above, Org needs more control over the behaviour of
`kill-line'/`kill-whole-line' when the visible line contains multiple
lines of hidden text - to protect accidental deletions.
A hook, where Org can intervene with a yes/no prompt, would be useful.
It would also make sense to group the two edits together via
`combine-after-change-calls', although a more universal way to know that
certain edits are a part of the same known command (even when called
non-interactively) would be useful.

In addition, `org-kill-line' acts specially in certain scenarios:

For
* Heading <point> text :tag1:tag2:

`org-kill-line' will keep and re-align ":tag1:tag2:":

* Heading <point>      :tag1:tag2:

It would be nice if we could express such behavior without overriding
the `kill-line' command.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 65734) by debbugs.gnu.org; 4 Sep 2023 15:21:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 04 11:21:13 2023
Received: from localhost ([127.0.0.1]:52284 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdBO4-0002kZ-J9
	for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 11:21:12 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33848)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qdBO1-0002jz-VM
 for 65734 <at> debbugs.gnu.org; Mon, 04 Sep 2023 11:21:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qdBNw-0004JS-IH; Mon, 04 Sep 2023 11:21:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=7ahRt/wjTK4lHDvlmLpmIr0eHW6Abli8IxWhkqYZoP4=; b=aU45XwACF08a
 v/8SP8pdHSrV7txvOrSaUgP+ccxmCG4+iKn5nSXbiV2lEC5kKIOdNYe+Ui66SjKzqStxVTJ+8bs4b
 EFsDnC+Twe2EflqnsdOTyBE7cJlNzuTU98DccKtoeO4hSHPxLOW0X38fRFrNw7ar5b2LC5E4fp9p0
 cmfVp6AclIS65hIGaAEQJVotEDxph55lVhuyugJjIAxgYOrQ4zlrP81fVRcOIdUfWuYFvpLg0b2FK
 W+Ryj89lQkNWsLGcnWU1dn8Q0M7ekABnjoSyUn2qm2cG0s+kCrt/jGNnPwLMmfhMUW8md53ZrPczD
 zNoJikJZ9r4VZfV7KODDLw==;
Date: Mon, 04 Sep 2023 18:20:46 +0300
Message-Id: <8334zu55ip.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sebastian Miele <iota@HIDDEN>
In-Reply-To: <877cp6atag.fsf@HIDDEN> (message from Sebastian Miele on Mon, 
 04 Sep 2023 16:44:19 +0200)
Subject: Re: bug#65734: 29.1.50; kill-whole-line and visibility of Org subtrees
References: <877cp6atag.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65734
Cc: 65734 <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 (---)

> From: Sebastian Miele <iota@HIDDEN>
> Date: Mon, 04 Sep 2023 16:44:19 +0200
> 
> In an emacs -Q, create an Org buffer with the following contents:
> 
> <-----cut-here----->
> * AB
> ** C
> <-----cut-here----->
> 
> Fold the subtree under the heading AB, so that only a single line is
> diplayed (ending in "...").  With point between A and B, hit
> C-S-<backspace> (kill-whole-line).
> 
> Expected: The whole _visible_ line, i.e., the entire contents of the
> buffer is erased.  Actual behavior: The line with heading C remains.
> 
> Contrast this with the same experiment, except that the point is at the
> beginning of the line containing AB when hitting C-S-<backspace>.  Then
> the expected behavior happens.  And according to the source of
> kill-whole-line, the intended effect indeed is to kill a whole _visible_
> line.
> 
> The following patch fixes the issue:
> 
> diff --git a/lisp/simple.el b/lisp/simple.el
> index abd587245fe..44221f3fc24 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -6649,9 +6649,7 @@ kill-whole-line
>  			     (unless (bobp) (backward-char))
>  			     (point))))
>  	(t
> -	 (save-excursion
> -	   (kill-region (point) (progn (forward-visible-line 0) (point))))
> -	 (kill-region (point)
> +         (kill-region (save-excursion (forward-visible-line 0) (point))
>  		      (progn (forward-visible-line arg) (point))))))
>  
>  (defun forward-visible-line (arg)
> 
> The reason for the issue probably is: Without the patch, the killing
> happens in two stages.  The first kill-region kills from the beginning
> of the line until after the A.  That kills the leading *.  That probably
> somehow triggers Org visibility changes.  With the patch applied the
> whole killing happens in one stage, probably without causing an
> intermediate change of visibility.

I'm not sure I understand why this is deemed a problem in Emacs.
Shouldn't Org redefine C-S-<backspace> if the default binding doesn't
suit what happens in Org buffers?  Did you discuss this with Org
developers?

Thanks.




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

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


Received: (at submit) by debbugs.gnu.org; 4 Sep 2023 14:48:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 04 10:48:48 2023
Received: from localhost ([127.0.0.1]:52156 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qdAsh-0007UE-FB
	for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 10:48:48 -0400
Received: from lists.gnu.org ([2001:470:142::17]:43234)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <iota@HIDDEN>) id 1qdAse-0007U0-Dn
 for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 10:48:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <iota@HIDDEN>) id 1qdAsY-0006kH-Qm
 for bug-gnu-emacs@HIDDEN; Mon, 04 Sep 2023 10:48:38 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <iota@HIDDEN>) id 1qdAsV-0004f3-Nb
 for bug-gnu-emacs@HIDDEN; Mon, 04 Sep 2023 10:48:38 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4RfWj53xDBz9sq3
 for <bug-gnu-emacs@HIDDEN>; Mon,  4 Sep 2023 16:48:25 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whxvd.name; s=MBO0001; 
 t=1693838905;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=6Huq3AG4xSZflw5Niv52R/X7Zyuny0jyJiF91e4h/m8=;
 b=Qnj0Npve51aCohXN9JhsUWCOeAjaMxjylcE43pNpmr1giz7XZruFiQmtBM6+bYiJuLs3KI
 n5BR1xXRqoYnV7U0lt2PsQxuwzq9CrbfVgIeWGg6OjRDkkrXYRQDRwQ2UE1WCFKmuEYX6J
 XGyU/qvQ5jJHnYEvlU74sm/IQw7Dvvv/8Ttc5umWhys3Mm6HNvitVUPGucdnP91xolxs9X
 A37snohwihK82Yd3sOx/BNnqlLr4Xyo3KqIyVIMZEGQEVJzmfaaq2+Vo6o89/2gQev1fZC
 /0v9/rGhQH7b4CMpNLwZcUhhaAeexapUApd7aRFHUVH8NgK9rjGHjGFGEdswpA==
From: Sebastian Miele <iota@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.1.50; kill-whole-line and visibility of Org subtrees
Date: Mon, 04 Sep 2023 16:44:19 +0200
Message-ID: <877cp6atag.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4RfWj53xDBz9sq3
Received-SPF: pass client-ip=2001:67c:2050:0:465::101;
 envelope-from=iota@HIDDEN; helo=mout-p-101.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
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: -0.3 (/)

In an emacs -Q, create an Org buffer with the following contents:

<-----cut-here----->
* AB
** C
<-----cut-here----->

Fold the subtree under the heading AB, so that only a single line is
diplayed (ending in "...").  With point between A and B, hit
C-S-<backspace> (kill-whole-line).

Expected: The whole _visible_ line, i.e., the entire contents of the
buffer is erased.  Actual behavior: The line with heading C remains.

Contrast this with the same experiment, except that the point is at the
beginning of the line containing AB when hitting C-S-<backspace>.  Then
the expected behavior happens.  And according to the source of
kill-whole-line, the intended effect indeed is to kill a whole _visible_
line.

The following patch fixes the issue:

diff --git a/lisp/simple.el b/lisp/simple.el
index abd587245fe..44221f3fc24 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6649,9 +6649,7 @@ kill-whole-line
 			     (unless (bobp) (backward-char))
 			     (point))))
 	(t
-	 (save-excursion
-	   (kill-region (point) (progn (forward-visible-line 0) (point))))
-	 (kill-region (point)
+         (kill-region (save-excursion (forward-visible-line 0) (point))
 		      (progn (forward-visible-line arg) (point))))))
 
 (defun forward-visible-line (arg)

The reason for the issue probably is: Without the patch, the killing
happens in two stages.  The first kill-region kills from the beginning
of the line until after the A.  That kills the leading *.  That probably
somehow triggers Org visibility changes.  With the patch applied the
whole killing happens in one stage, probably without causing an
intermediate change of visibility.


In GNU Emacs 29.1.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-09-04 built on huette
Repository revision: 5cbe96d17f67e58091de1653f409d87bcc2b3e99
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Arch Linux

Configured using:
 'configure --with-x-toolkit=gtk --with-native-compilation
 --with-tree-sitter --with-json --with-mailutils --with-imagemagick'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp comp-cstr
warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode
cl-loaddefs cl-lib bytecomp byte-compile rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 66653 8786)
 (symbols 48 7137 0)
 (strings 32 20076 3360)
 (string-bytes 1 606691)
 (vectors 16 16454)
 (vector-slots 8 296368 15462)
 (floats 8 29 22)
 (intervals 56 240 0)
 (buffers 984 12))




Acknowledgement sent to Sebastian Miele <iota@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#65734; 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: Sat, 20 Jan 2024 12:30:02 UTC

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