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 qD8LDRIboGUDIgAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 17:45:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8JvoCBIboGU8jAAAe85BDQ (envelope-from ) for ; Thu, 11 Jan 2024 17:45:06 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=lwhJUrCA; 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=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704991506; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DcbTcDZxTaZi7cKNxiZYO5Yl4+e6D+u211Y4dRNFhcg=; b=G8S6yqXrFqjCubbNJmOzt7s6ZobdvBnVdByCgrSnUrUo0IADtoM28h1A/xUysgGCRM9DrB oSRxf1heUW6xaf2qnnngRrBKYBRD6HHecdZ1a19lIxf8jgqbaXtK2GnurBSj24S6tqkcUF 5sjv9FqqczQcdmvhAHgcCyyR1CG5QkOFJSzxcDfjh2pOEMWsB9Doz5favolWd0sj/0lol1 W4Aq1858tbnMRxqD2d/u6o0iugmmCrf1tjaCjOfz2n3yL57T636So1drpWA5uO/W9BdtvI XBLePGY7LCUzuVKLcAIjMYsFk84dH9JpUH56fQOH3Cp/LfxTHPdmKZsmFfIiJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=lwhJUrCA; 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=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704991506; a=rsa-sha256; cv=none; b=Wwx57wr9xtT2UvkblyotZnWrmSvg4AR9WvUKC44mw3oQRFxY6uCWpsxryIOyKWcDkJmDrr aZrqtMZXjr8bvfVmj5R/qa2NruWBgZxV5KQUjJXNoFavKGTB62dp4nKcgSTHN2ElUmlcjV WF1TPDyJVLuiduaMJv+54KsfXqjPRqupGekXTz7p8DcYfzPVE6roM7QyERZpbbHeIx7WIy elD65xwToyqHpjv4GVkTUX3vIeWncj9cVfhzJrYt44zrENpmbSn9E7dxiqOq8EJ6ld0Ezk OIvwN4Mj/xDyn/aub5qVHedAUAYhSbLbCugo3epTW79Cj0x5OIyGMybGPe8xDQ== 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 B07305A508 for ; Thu, 11 Jan 2024 17:45:05 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNyAc-0005GQ-Bx; Thu, 11 Jan 2024 11:44:42 -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 1rNyAa-0005F4-0f for emacs-orgmode@gnu.org; Thu, 11 Jan 2024 11:44:40 -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 ) 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@gnu.org> From: Eli Zaretskii To: Ihor Radchenko Cc: monnier@iro.umontreal.ca, emacs-orgmode@gnu.org, 65734@debbugs.gnu.org, manikulin@gmail.com, iota@whxvd.name 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@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> 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-Spam-Score: -8.38 X-Spam-Score: -8.38 X-Migadu-Queue-Id: B07305A508 X-Migadu-Scanner: mx11.migadu.com X-TUID: juvVdB2KQA+R > 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.