From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cOZbNBgWnGXRDgAAkFu2QA (envelope-from ) for ; Mon, 08 Jan 2024 16:34:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id oMjcLRgWnGXGOgAA62LTzQ (envelope-from ) for ; Mon, 08 Jan 2024 16:34:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=bKW619XA; 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=1704728088; 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=me/lEwE/YnfBaD2NGYIDPZM7vKp/Yr4z9HT/XND/D5U=; b=umryGqW7rX0j/yKfC0F5nI7/wyPtGoz8AlV4/dSEnc6XgOPT2kXt0WoV/PYMcWQysIC40S mavWJZ9ghJy69x5vccd6AwF/OS3FViCiSmVBhzHyY3Qh9v6tlB8/ntc5tr6jKsEaD0eYDb 3NmiouO23ofgDLHKkwctMv/LBYGynHFcWdqkZXvYrPx0XK5Mrf1TeYzun3/b/Xt7GR3F1b wc0IoxC3lzV7ixhso8suCcqfG/ovgK5H/k1I0AMnf+W0ERVVfCNegLc66eKp61qf1abiZC q8Go6sTjg1xG3sVRADmj3la3S3RrpcX/ylElVGMyWIWioqnQg8Ce9c5tSagc5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704728088; a=rsa-sha256; cv=none; b=LnK+NEzzN1zbrMev7l/x4Ih4dOpFErl4VN/B36BZvNdwq3CB6suSEB49uvC7cauhQAW7BP yjdSNVK+/bBp6C2am1TVjXUWWtmSv/20vqvba19s6cwW02dE8xkm8VrnsXiWihMdU8QBtg YKVE3xywUuPfAQCwuRQgWcZicBpS75st8TVQYQaT2uVRIAI+j2m27ZmSngaD2MiISlsYB4 YLNhmTBnITPfXmcJtdLRN8AA0b+I1cwgI3vX5nXOdJFdahcaV2xi/oN3196Ces0HXlrkt+ f4k7+JA9rjnQjou64k3/XSNAwxcD12GKSs0AOmXuM90l7+3MdSYpwo6orxkYrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=bKW619XA; 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 01E5177445 for ; Mon, 8 Jan 2024 16:34:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMrdb-0003uj-IM; Mon, 08 Jan 2024 10:34:06 -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 1rMrdR-0003uM-1y for emacs-orgmode@gnu.org; Mon, 08 Jan 2024 10:33:54 -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 1rMrdN-0004Ds-Uc; Mon, 08 Jan 2024 10:33:52 -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 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: <875y04yq9s.fsf@localhost> (Ihor Radchenko's message of "Mon, 08 Jan 2024 12:15:59 +0000") Message-ID: References: <87il8pao4l.fsf@whxvd.name> <87tts8vrpb.fsf@localhost> <83cyyw4of7.fsf@gnu.org> <875y4ovct9.fsf@localhost> <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 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: 01E5177445 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.68 X-Spam-Score: -9.68 X-TUID: Ceca2UzXsbKY >> 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