From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cB4dNpMxoWX4MgEAkFu2QA (envelope-from ) for ; Fri, 12 Jan 2024 13:33:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id yA7gL5MxoWUmAgAA62LTzQ (envelope-from ) for ; Fri, 12 Jan 2024 13:33:23 +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="T/TGS4AI"; 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=1705062803; 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=cuB2vXyaGZ+X28AmeToJKwSMdH0WRpdNWcCzLuzWXRg=; b=I8cEx8I0hTL7omG6wdFMaSDDLFz2hkbTjrbGBDpsfyiwJTSXMo8qA1gx3QbNzJGyJhK7dS D07IB8eqiWU2arttmHCBFqdYzQrbrqXZvBk7Dzg/tvmBMwl6hPRSGZSdXCj3bi8bUGp3KR 7dgZNhDWxmdvTmmr1ciM7Jv6RnQYNqUK5DDPwN1Fikx3MtXvPyhByiyPwD3sHlxMsFfhQp GQvUSScgoTFAzXCoUF9RgH1mpsGMhRv/O35yCuQUApPqXRfQxd4Li3urF0EvxWbyAW0ilQ XpjhVmz2tQMi8ASOBWRV19gNst2rrZXha4czM1qHk5OY9yfc5FvnrtaMsjutWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b="T/TGS4AI"; 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=1705062803; a=rsa-sha256; cv=none; b=I3BciqdXdS6t39yYvF8M5ECPzModahhrGmRp/G4ZKpAMdo8yx6cw/w2kTdbCnT8bZcj3m4 SHG8Q4gPx8TtGSwJfdwym3pMDn/EwLXDaOjWqatVNpBS5ly3mVlWxnyikG4y2s0ijc3gZZ 1m5lr4qT+A5ho217D3zxT8pIRkGLEL94klr9SGxv/4R6WfQI6jhSehWlE3GUe69OqegPi4 /PwnY58ALKWlOofjXGVDc5tcHp5s7kyIccKrQdfd46Jo5HpAYy1OP99DuLg+jGghvVELzk JnuYd5uavhlrA10Ku+SUtiJQvCqPu4n5Qni9wLN0UhEmw55FndFJNaKa+obilw== 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 76B9E3C3D2 for ; Fri, 12 Jan 2024 13:33:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOGiB-0002ZJ-W9; Fri, 12 Jan 2024 07:32:36 -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 1rOGiA-0002Yz-9l for emacs-orgmode@gnu.org; Fri, 12 Jan 2024 07:32:34 -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 1rOGi8-0002op-LX; Fri, 12 Jan 2024 07:32:32 -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=cuB2vXyaGZ+X28AmeToJKwSMdH0WRpdNWcCzLuzWXRg=; b=T/TGS4AIGWvg XitZmHveD59S9/ZCfhDlTkLLEqp+6h6fnrGOEfpqas6gsEAo8Nm66RVJJcH2nM3L0nArH8BRjsp25 XNHxguP9oznKQMbtlszZ00AKhyY2+nF6m6H4Nda8k3gjAtaXXslIB/Ox0fDfs2pbOQpdC7sD8kD3r HopZjQo/hWcSqV8IbLh4F/g6ecn9/BQlbDB7djM1F1lLHvdZ5Md0CgL1TBvhPU4dSqdFimFmprmd5 /sMwfCHdC0lWiGEjpejZZgpc4ZPlyUjPfqzJLn9Wn3uVirfKMwjkqjFFEbGaKJrx69EO0KIDt6oGd fDBtwdSc9oqAj+X+A54qVw==; Date: Fri, 12 Jan 2024 14:32:20 +0200 Message-Id: <83zfxaivfv.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: <87le8uhh9a.fsf@localhost> (message from Ihor Radchenko on Fri, 12 Jan 2024 12:24:01 +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> <838r4vlt0n.fsf@gnu.org> <87bk9rivzo.fsf@localhost> <8334v3lltf.fsf@gnu.org> <87le8uhh9a.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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -9.25 X-Spam-Score: -9.25 X-Migadu-Queue-Id: 76B9E3C3D2 X-TUID: 0XRgc9tcO7U+ > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, emacs-orgmode@gnu.org, 65734@debbugs.gnu.org, > manikulin@gmail.com, iota@whxvd.name > Date: Fri, 12 Jan 2024 12:24:01 +0000 > > 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? It might, yes. But do we have to _replace_ the hook? cannot we have both? I.e. if the new one is defined, call it, otherwise call the old one. That would be more backward-compatible, I think.