From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +EFeCAguoGXevgAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 19:06:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id cA+QBAguoGVDVwEAqHPOHw (envelope-from ) for ; Thu, 11 Jan 2024 19:06:00 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jwKBGvqC; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704996359; a=rsa-sha256; cv=none; b=JjXv3Rxg393qLYCtalL8Ug72KZDpwJBtr0xAQZHLLagkuD/3OJei6Tl7aK5c16EFQU6IGd 2yUaYKQpEaz7/QNg/ZzyCXEW9qZEpS3+6BpwW0DO/HpGU+jplJo17MjF7wh6LLzOcHlyQh ldmXTsS/zF2yaZdYq5AAN3QK739uGN35Pzr8Q+6DyD/t1XuT1z7B2bGh/0qVQabPqxXc9v RaeXhyTPWNYDtQcZPoXi//WzTJWODyWQyxX0H6tj6uQWoz1VhFNCl2wr8AK5HlEh237CE8 Ut0XYjRATWVJFNS59Ide6im680G/Uu3tDoOYQBOkKxM246alf3lYTjJgNIKAUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jwKBGvqC; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704996359; 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=JNuR5EjmtB/24bCB0LXWqf3LsFEMi9pPVcK8Ch/3kn0=; b=KpdXK3lrE9hBRqSd6TleMOr5PC/O3HZEFySi5bQilwwivdxj9GtPwi+osFO4jSo7DJGgzq w6Mt7ltAOokDNw8Y62ztViD8uBeDG3ktK8Z17OhJTeBBsZvgXQVai9OpjGslWNTvl73TGi 325SmTqkDDnjM/0vP+YabmgV5Dk3WUjJ+3EeyBc/f/fdkMveab+NRJMVaWZeBoHmuBK2Qy QQl1pyU0stUoNG8sszyotPL8zESKdHgPmjvIVe5U5P7XxTvMmjECWzZryhutA8fHQ22B7o GHQyg0/wlBkdE0SzqbO3xo2MwqpcoZ0p/TnlSO1xVNAvU83oufgE5PVPghAs1g== 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 A6A7242840 for ; Thu, 11 Jan 2024 19:05:59 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNzQW-0007lF-6n; Thu, 11 Jan 2024 13:05:12 -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 1rNzQU-0007kn-Eb for emacs-orgmode@gnu.org; Thu, 11 Jan 2024 13:05:10 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNzQQ-0007in-K3 for emacs-orgmode@gnu.org; Thu, 11 Jan 2024 13:05:09 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9B407240104 for ; Thu, 11 Jan 2024 19:05:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704996303; bh=lTse73jpxmOQOLqRc3wxjXnVtlcEXBtKhqALK1wuoKQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=jwKBGvqCti3ygM+MsxXOKBy5pnC5UafrQOvS7daIWU3Wbt5C3q+kUu8N4fZUxMlrv g13hSukRHz1w84vaaCmy7yGCn27QhH/Wo5ZSArNE7HSRPJJfmVkR6A/o1rZk0pTjNP bjqma5lbYrqIt1f9lZ0Jozm4vPutRMwlFxaasK0PmtoZMz2TvAEorEwoOEBwGFiFfd PUUDcFvRWgjeXgtvELzzCJZX79pY8z09Ud14M/Yj8GoXgxfKj4g/Z6TBcKFZJgpIJK d5RdnK4cbbDh7i4Dl0pRWydkuXpwmjFFXx8Wj1XheXtzYz92/yv2iMCwsBbBpLO3Ws nx0ZNCN5bSqJw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T9syQ3F2jz6tvw; Thu, 11 Jan 2024 19:05:02 +0100 (CET) From: Ihor Radchenko To: Eli Zaretskii Cc: monnier@iro.umontreal.ca, emacs-orgmode@gnu.org, 65734@debbugs.gnu.org, manikulin@gmail.com, 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: <838r4vlt0n.fsf@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> <838r4vlt0n.fsf@gnu.org> Date: Thu, 11 Jan 2024 18:08:11 +0000 Message-ID: <87bk9rivzo.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -8.12 X-Spam-Score: -8.12 X-Migadu-Queue-Id: A6A7242840 X-Migadu-Scanner: mx13.migadu.com X-TUID: MVjViZuhKq6Q Eli Zaretskii writes: >> > 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. Let me elaborate. In Elisp, I am thinking about something like: (defvar-local kill-line-query-function #'kill-line-query-default) (defun kill-line-query-default (beg end) (let ((nlines )) (when (> nlines threshold) (format "Kill %d invisible lines? " nlines)))) Then, Org mode can instead have (setq-local kill-line-query-function #'org-kill-line-query) (defun org-kill-line-query (beg end) (org-with-point-at beg (when (and (org-at-heading-p) (progn (end-of-line) (and (< (point) end) (org-fold-folded-p)))) "Kill hidden subtree along with headline? "))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at