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 XVuGCesuoWUSJwEAkFu2QA (envelope-from ) for ; Fri, 12 Jan 2024 13:22:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6GNnAesuoWX3QAEAe85BDQ (envelope-from ) for ; Fri, 12 Jan 2024 13:22:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nvtoOVUB; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705062122; 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=afgaWLYYXVwBDnXXBd9jyKBWfmw0NmWrOIstZ2HQIRc=; b=Z1lV6AFP9j2HIu5iUWTR8yVWP62fSm+St8KQhmehc6vdBtXFitQn4H0YYgh6mc14+tIjd5 ufiZ6ItS6zVXxKJ6nqbrGRSzpuEsHWNANAmRH+EQPqaVmLa3nszkl70VL+rCu0VVuB5zWY F8ZycTV1vXjKgGMHoyWSuWHvtw7sHWdefiS9DUPXxX0VQ9XQQVMHY/0cN9+FtURV/iGDta uLdzyrWwg/KKfcjyN77/XUvohLaxaGs99tT6Ul8bTd51eL5SEXC28jg39extDxddBNUHGW kfqRz+qtZpX0fdiSfqYdMEUoDtOQ3MhNHetv2U8ScK99t8b91f/LOgIsjFJ0kQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nvtoOVUB; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705062122; a=rsa-sha256; cv=none; b=PXxOI5GgGG33jPck5Nasaac9FKNzuiMvfFUAzPK/wj1+3BFGxNJY3I9s1WX1nDy2o0pHN/ g45OVpHKynIXG8mK77hViCREhFmFdN/hExdkuhF6a4N27AEzeRy+TC/JxG7+/bHut69KV2 aGs/BLCfhbwbxJcGrIRR5eE7zTFbTHH0QvRS65rTY08+nDex/p6tLQQN+HQIvx2E6D7AIq cIqikG2zn6jWMwwoWtc9SJ5rV2Ctta2GCOxjETyfAB3ZdHObHlQm3NMo94/5jCfkuMDAif 93FhEGB576YFSGXl70IQc5uqMdE4+p0QqkWU7IIGcewc6K7w5WM66Edq5omMBA== 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 E2FD561A1D for ; Fri, 12 Jan 2024 13:22:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOGWu-0000XG-3n; Fri, 12 Jan 2024 07:20:56 -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 1rOGWs-0000X1-7J for emacs-orgmode@gnu.org; Fri, 12 Jan 2024 07:20:54 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOGWq-00059r-5I for emacs-orgmode@gnu.org; Fri, 12 Jan 2024 07:20:53 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3C57924002E for ; Fri, 12 Jan 2024 13:20:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705062050; bh=mnnzPaC0lQ1vV5ME0VeuX8LE+U3Ccw9z+SG6Ipuv9BY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=nvtoOVUB/S1wUYfqm53Sqf2zuDF+2hkH2ZQHNSZtdnU8fgUuWL1SeXQRFT/Cqru14 3FiGvwEh2Uq0/UAtedhR5ZSrbU5lRcVvZmm9jvI8ZjLbIjHd71TgoonpnLoYXCc0VC WyTFO5SDtLhSetPRoyu9hWXMrjWF4gU4df3hqkzhnz/B+yUslGlrUNi2Ry3wZvC9Oo fCJxlZzyWFPEpOJHq7OUlB/LdPNOLaTOCqco4SSC13MvH5UurY1KE4mGIrJ/tqD8oh 8S95JHPu3KGmHKMiMoxH98OhZGEtgY0GURCgVtGPJHZ0QFI3syooJ5f5hJkuC3XG33 cV8hPKPQs5nvg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TBLGm6BYDz6tyZ; Fri, 12 Jan 2024 13:20:48 +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: <8334v3lltf.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> <87bk9rivzo.fsf@localhost> <8334v3lltf.fsf@gnu.org> Date: Fri, 12 Jan 2024 12:24:01 +0000 Message-ID: <87le8uhh9a.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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=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-Spam-Score: -7.61 X-Migadu-Queue-Id: E2FD561A1D X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -7.61 X-TUID: Tf7WSUtuYPzj Eli Zaretskii writes: >> 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? "))) > > I don't know what org-with-point-at and org-fold-folded-p do, but my > point is that you should consider the case when kill-line kills > invisible text that has nothing to do with Org's headings and trees, > so I suggest to either make the detection code smarter (so it could > distinguish between the two), or make the prompt text vaguer (to not > claim that the text must be a subtree). > > And if that is still not clear or you disagree, let's leave it at > that. I think that I see what you mean. What we can do to achieve this is changing `kill-line-query-function' into abnormal hook `kill-line-query-functions'. Then, `kill-line'/`kill-whole-line' will use (run-hook-with-args-until-success 'kill-line-query-functions) to decide whether to show a query. Does it make sense? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at