From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs,gmane.emacs.orgmode Subject: 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, 07 Jan 2024 11:27:13 -0500 Message-ID: References: <87il8pao4l.fsf@whxvd.name> <87tts8vrpb.fsf@localhost> <83cyyw4of7.fsf@gnu.org> <875y4ovct9.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9583"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-orgmode@gnu.org, Eli Zaretskii , 65734@debbugs.gnu.org, Max Nikulin , iota@whxvd.name To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 07 17:28:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rMW0N-0002EP-Rl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jan 2024 17:28:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMW0H-0006M1-F1; Sun, 07 Jan 2024 11:28:01 -0500 Original-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 1rMW0D-0006EF-1F for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 11:27:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMW0C-0001NJ-P1 for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 11:27:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMW0I-0003hN-1H for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 11:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jan 2024 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65734 X-GNU-PR-Package: emacs Original-Received: via spool by 65734-submit@debbugs.gnu.org id=B65734.170464484914160 (code B ref 65734); Sun, 07 Jan 2024 16:28:01 +0000 Original-Received: (at 65734) by debbugs.gnu.org; 7 Jan 2024 16:27:29 +0000 Original-Received: from localhost ([127.0.0.1]:33627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMVzl-0003gK-Ar for submit@debbugs.gnu.org; Sun, 07 Jan 2024 11:27:29 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMVzj-0003g5-Id for 65734@debbugs.gnu.org; Sun, 07 Jan 2024 11:27:27 -0500 Original-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== Original-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) Original-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) In-Reply-To: <875y4ovct9.fsf@localhost> (Ihor Radchenko's message of "Tue, 05 Sep 2023 15:50:58 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277507 gmane.emacs.orgmode:158917 Archived-At: > 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