From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2FTqKZPQzWYcXAEAqHPOHw:P1 (envelope-from ) for ; Tue, 27 Aug 2024 13:11:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2FTqKZPQzWYcXAEAqHPOHw (envelope-from ) for ; Tue, 27 Aug 2024 15:11:47 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aexOgyBx; dmarc=pass (policy=none) header.from=gmail.com; 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=1724764307; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kTdCDSoS8Mm6dZr+o4GqnGRom3ZIUhhdkWJAIgknvi0=; b=nGzs9cFzqccABDgDYHSq6K3Ex8WcI6o1Bc6cfdFPq0B3WNijWZ9GD4pOcpiwlMPPZhSF7I mKAsQckLAa60CGGt9N7Lp4JuqwegUxbvV1aJlDzm1bjn2SXAhdnh1HCpHaXvxindcXzMet 5hib/bYT7GldiuP29BRHOnc+DwJL2H+rZtb4Q1vjBdGtUsSeexMXgjZsSiznRmuLjSHD7Y ORunPwcnT7WREr2i75BK88IhPrOmgM+DW2mkA6XVLtf3kcdHAV/wbDUr6DKFrCXFbq2ylx XFhE1DssEWoXzQh7ju0DtUHWFy9w5ES/BR265Du7HMVpbtGn/poicnjbwKM1AQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724764307; a=rsa-sha256; cv=none; b=onsaIDCDhw1vIQnmQdjn1EgOJ2jsdgcziVn0BGOmwB+JT+O3aTmPrRMjYiTaKGLaRV5+nG LxtvxJ58MN1e8/72QaPqesmJPQiBHvgK44//5GkbjZA/czVjFlKAq3pnj3/UA5bRoCUJ+z XdVlMxLFM+urxolA4Gfuu1XfSEYeaF2wohv95XDLnh+EX3tgr8MrCBSkCbkAw9ioN1J1yj 1LiyWlSc3lkaOVwbQ6yuscvr+OdhYItdrsDtTZmrn02RH/8i/GbpstfUtoJp5AVWIwvfRb 8GilThnnAvvWhfJn8nTaC/J1zewKvfJgbxVKB/Psr4ltv11qrfCpweimBflPZw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aexOgyBx; dmarc=pass (policy=none) header.from=gmail.com; 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" 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 824BADDA3 for ; Tue, 27 Aug 2024 15:11:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sivy8-0001aZ-Qs; Tue, 27 Aug 2024 09:10:44 -0400 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 1sivy7-0001a8-BJ for emacs-orgmode@gnu.org; Tue, 27 Aug 2024 09:10:43 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sivy5-00047c-T1 for emacs-orgmode@gnu.org; Tue, 27 Aug 2024 09:10:43 -0400 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3db51b8ec15so806182b6e.1 for ; Tue, 27 Aug 2024 06:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724764240; x=1725369040; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kTdCDSoS8Mm6dZr+o4GqnGRom3ZIUhhdkWJAIgknvi0=; b=aexOgyBx9zXpqywqpOgk4L1+nAIBeZyTViIF9XBIjsUkTbEkuAIQS+5jMFTHhUXS3E dXXWaI5VTWzom5ZQfe2Yjpq1xGwAHL5YPv3C13d73S17tkQ5fCsYDkTw4uhfUbhnffuz Shau87Z1mqvGFZiGCc7Rw6jpHwow5wANP/VW/FoYVQWAjWSEVJt7djNilouS72OiEpTo flUHS6qwshZzp91csiSOjffm0SLntTTDfKs3jtFS2rJJLB/jlhwcmGfRhvoo2hNPIw7l +0RRoCXjy8IbI3qU6y9YKWyeuWVew/Av0az+YzImXhlkVS4TfOZtnk0Jwf5ItjbeFK3H sggQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724764240; x=1725369040; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kTdCDSoS8Mm6dZr+o4GqnGRom3ZIUhhdkWJAIgknvi0=; b=VkHhd4lskKsSQQqAL1sOkS4PgC3300c1p8ZgoutcMrT1zx4LG23vF1KYVojg1HYUMl 18SmcvM1l0qDdt7qUwyjJxb41j2Q4GBNR/at/PFGOnNJ3rDO8LbZ9aAg1Elg3xhTB47f l60G3POQmcV7LyJjRfQnV5ZZwLF9FKK3ZPxTQyIAjHlh9pRzKZ1U/v+LHLf6ZCw9/r6w CmeAZFLoU7t6jlfei5+Qj6GXJQn6BNsGD5TLi1/U2H2o5ZOJiWgoXVoRHt+qSidmFddC 3JGemPu3psjVgY1i78Ly1krs6n7Syx8CYQ6dnimvibdJ40F0/8uMVlyeLOo3Pd5S0ltf eqoQ== X-Gm-Message-State: AOJu0YylgSQpkYvklidFMTT/j7I9Ey0zvq7VHp24p3VZncvhznViG4/6 RUMesX5+NRH3uR5HNrweRh1dcki2oCLVlC/rVCKIrLvNEhrmxCRiH8Fd7mQ9nLyAnWyKIs09CKO JJc2KT1Aqgl+HbUW6YisSkkbdfiUHAH7j X-Google-Smtp-Source: AGHT+IGMsM887ycGHHH/hmXVp2qfg19O9fcdQNzuy/A7d3gld41rbkQZxpQ+UONIk6TI5OiLL6l3t3VG9vWw4H3TAp8= X-Received: by 2002:a05:6808:1795:b0:3d9:dabc:7b7d with SMTP id 5614622812f47-3def3c15a2emr1232232b6e.15.1724764239777; Tue, 27 Aug 2024 06:10:39 -0700 (PDT) MIME-Version: 1.0 From: Dan Drake Date: Tue, 27 Aug 2024 08:10:28 -0500 Message-ID: Subject: org-cut-subtree should respect org-ctrl-k-protect-subtree To: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=dan.drake@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Migadu-Spam-Score: -6.80 X-Spam-Score: -6.80 X-Migadu-Queue-Id: 824BADDA3 X-Migadu-Scanner: mx11.migadu.com X-TUID: L0bSdkS6XUR2 I customized org-ctrl-k-protect subtree so that when point is on a headline for an entry with some folded content, ctrl-k asks for confirmation first. However, I also have the "k" speed key set up; to me, doing ctrl-K and the "k" speed key are the same, but only ctrl-K respects the "protect subtree" variable. I took at look at the source code, and it seems like a trivial change to make these two things act consistently: by default, the "k" speed key calls org-cut-subtree. I copied over the "when" snippet from org-kill-line (which is what ctrl-K ends up calling), and this seems to work as expected: (defun org-cut-subtree (&optional n) "Cut the current subtree into the clipboard. With prefix arg N, cut this many sequential subtrees. This is a short-hand for marking the subtree and then cutting it." (interactive "p") (when (and (org-invisible-p (line-end-position)) org-ctrl-k-protect-subtree (or (eq org-ctrl-k-protect-subtree 'error) (not (y-or-n-p "Kill hidden subtree along with headline? ")))) (user-error (substitute-command-keys "`\\[org-kill-line]' aborted as it would kill a hidden subtree"))) (org-copy-subtree n 'cut)) Could this change be included in org? -- Ceci n'est pas une .signature.