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 21:19:40 +0200 Message-ID: <8334v3lltf.fsf__48539.0480885812$1705000889$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> <838r4vlt0n.fsf@gnu.org> <87bk9rivzo.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12961"; 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 20:21:21 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 1rO0cD-0003Cf-Am for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jan 2024 20:21:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rO0c4-00059n-W6; Thu, 11 Jan 2024 14:21:13 -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 1rO0bx-00059P-TJ for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 14:21:05 -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 1rO0bw-0002DY-7v for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 14:21:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rO0bt-00049l-O1 for bug-gnu-emacs@gnu.org; Thu, 11 Jan 2024 14:21: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 19:21: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.170500080215865 (code B ref 65734); Thu, 11 Jan 2024 19:21:01 +0000 Original-Received: (at 65734) by debbugs.gnu.org; 11 Jan 2024 19:20:02 +0000 Original-Received: from localhost ([127.0.0.1]:33914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rO0av-00047d-Uh for submit@debbugs.gnu.org; Thu, 11 Jan 2024 14:20:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rO0au-00047E-Es for 65734@debbugs.gnu.org; Thu, 11 Jan 2024 14:20:01 -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 1rO0ap-0001Wx-3g; Thu, 11 Jan 2024 14:19:55 -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=ykOq30SasERhAx5mA/1xzF9FWoNe62/hA3aadlJCy2g=; b=IKpq7hix/3+u Ht09gO5zwasjkza2XQgdZzL68H2J81zu7YgXJSDJrYNj3KBzdleLOgErJKKu5mUtMBiunNShZ3Rww n0se3kW9cMIgHHHG4fYPIWjvxcEbzOjP5xZ87FAHiPD4bO+F8sIGzN83PBL1Nb1hQC4mVcQh/p+Uv dA/+y49BPoQiyEslFlRatzJaqmlo2iExRgurD4NRbZqTK0JgypZUTm6BkDnK08eI8XwtXgxqEUJE/ x/aZg+mpegrV9M68MO4bxD9aWISe8dplbQovRae/WCYyySOg/9utc8S4ocwzUdvM2t35zZBB33PJQ elP56tBl6YwpfxVtWs2+9g==; In-Reply-To: <87bk9rivzo.fsf@localhost> (message from Ihor Radchenko on Thu, 11 Jan 2024 18:08:11 +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:277933 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 18:08:11 +0000 > > 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.