From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gBzzECbRmmUPAwEAkFu2QA (envelope-from ) for ; Sun, 07 Jan 2024 17:28:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UCM4CSbRmmUfhgEAe85BDQ (envelope-from ) for ; Sun, 07 Jan 2024 17:28:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b="hnbK6/Ol"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704644902; h=from:from:sender:sender: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=vWAHx8Tr5H6oELnnNlT1FgUyBUAKLX0MJJ/PLyuxPV4=; b=u1kmeEr4euIrS+hvPI87eim4xnV8t5kClM9ilEqyOh4FL5nfJVfrDT4sKZDYVPn0bQ/yfZ fsz34pt774fX10v4RvqSsyVx3PEzlL8qqIifdeZCh/oxYn6EBl7EeE41MnKeeOZOXlAwwK YdSeMqPgihXnkQ7rbLQmuJUJZnmCnzVQwteJK7VdSR2eaWLAgg/GqQspt7vJUKIrDVddYB lQ++l632j4nNIY1y/rIqF0hhXdqYanNQALhs8+TAp0iQbAMgT1C5eyn8x6n3iigwwjPxBL ePu8XiJv+SduMEVTgq9XOQP8cao1imvY/RnTtn4xjZFg/YR1DC1q6tmyv5C1hw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704644902; a=rsa-sha256; cv=none; b=BJdaGD3XQjmpfKMO/fHWQBjMdXDShyoq/gfSP9CRroV8ENzGNJ3aC1aipsYtHjN35SXfnl UWBHJfi26EWvtXnMWN6fW6FhebXPqJo/b+ncibEZGpIUzw8k6MMmcuIpPC+JwPmOKSKWG6 IVmeKVQLfgvz38nW/r/fliZPimdLzc65S+sKCbNyAOO4E+zizu3eUt34hKbcL071Q5vEBt uEORVZavC5jF6Wuva+g8n6tM/upZge1ethwc3RtfBhdljmqU0QIB5D6W2o/SihGx1wip2b f+JAFL3gyNIjmkfcLKKFoL9qqXgM2Nl0H4/9iQ0R/YFGkizwxq2gKMv81khAnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b="hnbK6/Ol"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BA0A826B88 for ; Sun, 7 Jan 2024 17:28:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMVzd-0005YC-Vh; Sun, 07 Jan 2024 11:27:21 -0500 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 ) id 1rMVzc-0005Xz-3Y for emacs-orgmode@gnu.org; Sun, 07 Jan 2024 11:27:20 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMVza-0001LP-5r; Sun, 07 Jan 2024 11:27:19 -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 To: Ihor Radchenko Cc: Eli Zaretskii , 65734@debbugs.gnu.org, Max Nikulin , emacs-orgmode@gnu.org, iota@whxvd.name 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: References: <87il8pao4l.fsf@whxvd.name> <87tts8vrpb.fsf@localhost> <83cyyw4of7.fsf@gnu.org> <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 Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: BA0A826B88 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.35 X-Spam-Score: -9.35 X-TUID: Lyjjr095fO7S > 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