From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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: Thu, 11 Jan 2024 18:44:08 +0200 Message-ID: <838r4vlt0n.fsf__45861.7612648354$1704991521$gmane$org@gnu.org> References: <87il8pao4l.fsf@whxvd.name> <87tts8vrpb.fsf@localhost> <83cyyw4of7.fsf@gnu.org> <875y4ovct9.fsf@localhost> <875y04yq9s.fsf@localhost> <875y02y0da.fsf@localhost> <87frz6w2zt.fsf@localhost> <83cyu9nyea.fsf@gnu.org> <87sf35pcds.fsf@localhost> <83y1cxmgws.fsf@gnu.org> <87ttnjj2dp.fsf@localhost> <83bk9rlusw.fsf@gnu.org> <87h6jjj17y.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38381"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65734@debbugs.gnu.org, manikulin@gmail.com, emacs-orgmode@gnu.org, monnier@iro.umontreal.ca, iota@whxvd.name To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 11 17:45:15 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 1rNyB9-0009ox-0v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jan 2024 17:45:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyB2-0005sT-C7; Thu, 11 Jan 2024 11:45:08 -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 1rNyB0-0005s6-0h for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 11:45:06 -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 1rNyAy-0002sN-MT for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 11:45:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNyAv-0003xg-Rf for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 11:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2024 16:45: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.170499148915192 (code B ref 65734); Thu, 11 Jan 2024 16:45:01 +0000 Original-Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 16:44:49 +0000 Original-Received: from localhost ([127.0.0.1]:33706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNyAi-0003wy-QL for submit@debbugs.gnu.org; Thu, 11 Jan 2024 11:44:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNyAc-0003wg-H6 for 65734@debbugs.gnu.org; Thu, 11 Jan 2024 11:44:47 -0500 Original-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 ) 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==; In-Reply-To: <87h6jjj17y.fsf@localhost> (message from Ihor Radchenko on Thu, 11 Jan 2024 16:15:13 +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:277917 Archived-At: > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, emacs-orgmode@gnu.org, 65734@debbugs.gnu.org, > manikulin@gmail.com, iota@whxvd.name > Date: Thu, 11 Jan 2024 16:15:13 +0000 > > Eli Zaretskii 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.