From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WHfSEsfjS2T7PQEASxT56A (envelope-from ) for ; Fri, 28 Apr 2023 17:18:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +KyiEsfjS2RMtQAA9RJhRA (envelope-from ) for ; Fri, 28 Apr 2023 17:18:31 +0200 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 C1CAFF281 for ; Fri, 28 Apr 2023 17:18:30 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psPqz-0004yT-KA; Fri, 28 Apr 2023 11:17:45 -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 1psPqy-0004yK-DX for emacs-orgmode@gnu.org; Fri, 28 Apr 2023 11:17:44 -0400 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1psPqw-0002LX-Lm for emacs-orgmode@gnu.org; Fri, 28 Apr 2023 11:17:44 -0400 Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-b99f374179bso7579114276.3 for ; Fri, 28 Apr 2023 08:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682695061; x=1685287061; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=QLsouE48gcBT84OWyn7pTkCdyQ7d7No1ZkGySEAW/IE=; b=cwIECY1cdJhh9OTqunIg4W3KNiDrQ+mEDyUQAFd7OLI7DnJRn08b5vkvptOlG2FeRM Pnnij6y11AWoXsFAqSZV0RSejhXWmNHkY/ULbF58Easfa9f79doe1g3Dsd+QnnEhC45s 2WWGjWqD5+LeRF/juTk3H2Id9MW7YlfyNC3WpIN33Ej13FxlJw2uB+W20HIxebspBhPq JGGtne3yvsyWNX0plN9Vz1y0ziknqAuKLVNF8aX+BmV+0u8HHi7rCC5u6JNh6rKE6MDX lH49NRKDSiBWvizeLfbEI7upwbe3p3g+AQSw7YZlVc39gKIYlUnd2lQxk1n1v4Z4R18Q ZQcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682695061; x=1685287061; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QLsouE48gcBT84OWyn7pTkCdyQ7d7No1ZkGySEAW/IE=; b=bPvy8VdS4f6DJdOUcfoKS7DmtOSfwV/Nc1QETAicYcM/Uoi7ipZXHqTBsrPxK3jrKh wl2FZwPb8cDDvof1WtE+NO+ib6zDffoxzdO+eMfZmr38I69Mixzca+GozYUccCkXfNyr L1Yy6d6VoPMKLD/OK1dYkLfBDPMkzaXRrfilJvYdVN4r5wIeH1XPUfMWlFP4LFQ7YUaC tv4TxMUnnCtagod3qog83zLnpfI6kK9I8vqlQGuy2Rvf1GnAa7uWnS8qzFRQwykZW2NX ujRLdYsRKu1PNwoaNhRqAB+16/Y01DjdhVWVXyXgq4t8NFvsMJobvcBDMNXkb+NvfB3Y x85w== X-Gm-Message-State: AC+VfDxCgL1KqsDmvW7IzFYg3xSO/uNlJIAsNDJukKNxxaHGvWybPr4d 7ktJ79Rwjzux36hCGGWtZAxLiqQco/KGur7XUhKi0Sqi X-Google-Smtp-Source: ACHHUZ4qitxeaEcVm4L5r3qTRGZqLdLPXOiKa4ZqhRhShLwnKAKqJFOUinpm9FErD2IseZopC4x6ZHFvRRvdZYN/GF4= X-Received: by 2002:a81:4f07:0:b0:556:2d9c:3491 with SMTP id d7-20020a814f07000000b005562d9c3491mr4055432ywb.46.1682695061529; Fri, 28 Apr 2023 08:17:41 -0700 (PDT) MIME-Version: 1.0 References: <87cz3o2vdb.fsf@ucl.ac.uk> In-Reply-To: <87cz3o2vdb.fsf@ucl.ac.uk> From: Philipp Kiefer Date: Fri, 28 Apr 2023 17:17:30 +0200 Message-ID: Subject: Re: Suggestion to increase usefulness of TAB key / 'org-cycle' function To: Org Mode List Content-Type: multipart/alternative; boundary="00000000000068673f05fa66f969" Received-SPF: pass client-ip=2607:f8b0:4864:20::b2d; envelope-from=phil.kiefer@gmail.com; helo=mail-yb1-xb2d.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, HTML_MESSAGE=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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682695110; a=rsa-sha256; cv=none; b=YR9mAIVUpsf3oMI2I9y4NiCsBusBn7/5g6YQxsB1ygx5TZu3/UuVqbJwl0GGhEhVSIBTF/ ANlHZZiu5YV1DMN0BasNhz926ghwfsLMzZx4hdOwbDRPmy4KegxpiMrtlrNz0CJ2gSDlHf vORqlxpYK+55CTMND99QS89/AC9MSmQurGyI38d6rTq/M5RU8Yr0M0XZmKdkbc9YDloOjJ 5t2xtvJH+4Uh8n4K4nKR2GCT15mvmegu1CRRdFGlxpANbNide3/mjp1gxOHiNVJHmzbcJm Fo9QwvZbYZgWgy10kixZRmWJHYAgOLTiV30+mLia/OmPakjxtfE6SaNHOwr90A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=cwIECY1c; 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=1682695110; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QLsouE48gcBT84OWyn7pTkCdyQ7d7No1ZkGySEAW/IE=; b=C9oFqX2tK0h7ZWptaAjN+pSXCfB5SmcaSmb8DAWoMpbchihGC3Sr7a6/tKRVVRYtvXmA2Y vSzhLH5W06smuTQ397+tasdt7NSfQlX7Ifb7aYLfQvmAFdIQqDm4eXgwoRwwbC5mwNnY66 KwdbQsQqWCJiWR1yKQhUsuKcTAbE4V0cGtWisN+RPrLABHpAGuaBlsLBbYhqBf5fo9mEkr /Zu7DK2woVXxAN6kZUvx2soy1TyWK46ty5kCPanD58jY6CExEVcgQOZ/EmhpTCBqbLMWqs BW5IjJPUbwWW/wj0i7JOLp0nx52Ed1LN/hn0yV4ASMJjdI6blhIhWSZm0AOxdw== X-Migadu-Spam-Score: -4.82 X-Spam-Score: -4.82 X-Migadu-Queue-Id: C1CAFF281 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=cwIECY1c; 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" X-TUID: aWr+THVWR54l --00000000000068673f05fa66f969 Content-Type: text/plain; charset="UTF-8" Thanks, Eric, I am aware of customization options. My suggestion was aimed at improving the out-of-the-box experience of (new) Org users by extending the usefulness of 'org-cycle' by folding the subtree at point from anywhere inside it that is not itself a parent item rather than doing nothing at all in those positions. I've used two flavours of dedicated outlining software for many years and both have easy shortcuts to fold the current subtree from any position - it is a frequently used action. Fraga, Eric schrieb am Fr., 28. Apr. 2023, 11:45: > Hi Philipp, > > On Friday, 28 Apr 2023 at 10:49, Philipp Kiefer wrote: > > Well, it could simplify things a good deal further if, on issuing the > > command when point is *not* on a parent heading, (non-global) > > org-cycle would instead fold the subtree that point is in, i. e. do > > 'outline-up-heading' and 'hide-subtree' on the parent heading. > > You could always bind TAB to your own command that does this. As an > illustration, I have TAB bound to my own function that invokes > completion instead unless I'm on an org heading! > > --8<---------------cut here---------------start------------->8--- > (defun esf/complete-or-indent () > (interactive) > (cond > ;; ((eq 'message-mode major-mode) > ;; (message-tab)) > ((and (eq 'message-mode major-mode) > (message-point-in-header-p) > (looking-back "^\\(To\\|B?[Cc]c\\): *.*" > (line-beginning-position))) > (if (looking-back " ") > (progn > (message "try inserting alias abbrev") > (insert (symbol-value (intern-soft (completing-read "Expand > alias: " mail-abbrevs nil t) mail-abbrevs)))) > (progn > (message "try eudc") > (eudc-expand-try-all)))) > ((eq 'message-mode major-mode) > (completion-at-point)) > ((org-table-p) > (org-cycle)) > ((looking-back "[ \t\n]") > (if (eq 'org-mode major-mode) > (if (looking-back "^\\(\\*+ \\| *|\\)[^\\n]*") ;a heading or > table line > (org-cycle) > (indent-for-tab-command) > ) > (indent-for-tab-command)) > ) > (t > ;;(consult-company) > (completion-at-point) > ))) > --8<---------------cut here---------------end--------------->8--- > > You could use a similar (and much simpler) approach to get what you > want. > > HTH, > eric > > -- > : Eric S Fraga, with org release_9.6.4-335-ge065b5 in Emacs 30.0.50 --00000000000068673f05fa66f969 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, Eric, I am aware of customization options.

My suggestion was aimed a= t improving the out-of-the-box experience of (new) Org users by extending t= he usefulness of 'org-cycle' by folding the subtree at point from a= nywhere inside it that is not itself a parent item rather than doing nothin= g at all in those positions. I've used two flavours of dedicated outlin= ing software for many years and both have easy shortcuts to fold the curren= t subtree from any position - it is a frequently used action.



Fraga, Eric <e.fraga@ucl= .ac.uk> schrieb am Fr., 28. Apr. 2023, 11:45:
Hi Philipp,

On Friday, 28 Apr 2023 at 10:49, Philipp Kiefer wrote:
> Well, it could simplify things a good deal further if, on issuing the<= br> > command when point is *not* on a parent heading, (non-global)
> org-cycle would instead fold the subtree that point is in, i. e. do > 'outline-up-heading' and 'hide-subtree' on the parent = heading.

You could always bind TAB to your own command that does this.=C2=A0 As an illustration, I have TAB bound to my own function that invokes
completion instead unless I'm on an org heading!

--8<---------------cut here---------------start------------->8---
(defun esf/complete-or-indent ()
=C2=A0 (interactive)
=C2=A0 (cond
=C2=A0 =C2=A0;; ((eq 'message-mode major-mode)
=C2=A0 =C2=A0;;=C2=A0 (message-tab))
=C2=A0 =C2=A0((and (eq 'message-mode major-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(message-point-in-header-p)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(looking-back "^\\(To\\|B?[Cc]c\\): = *.*" (line-beginning-position)))
=C2=A0 =C2=A0 (if (looking-back " ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "try inserting alias abbre= v")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert (symbol-value (intern-soft (comp= leting-read "Expand alias: " mail-abbrevs nil t) mail-abbrevs))))=
=C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "try eudc")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (eudc-expand-try-all))))
=C2=A0 =C2=A0((eq 'message-mode major-mode)
=C2=A0 =C2=A0 (completion-at-point))
=C2=A0 =C2=A0((org-table-p)
=C2=A0 =C2=A0 (org-cycle))
=C2=A0 =C2=A0((looking-back "[ \t\n]")
=C2=A0 =C2=A0 (if (eq 'org-mode major-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (looking-back "^\\(\\*+ \\| *|\\)[^\\n= ]*")=C2=A0 =C2=A0 =C2=A0;a heading or table line
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-cycle)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (indent-for-tab-command)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 =C2=A0 (indent-for-tab-command))
=C2=A0 =C2=A0 )
=C2=A0 =C2=A0(t
=C2=A0 =C2=A0 ;;(consult-company)
=C2=A0 =C2=A0 (completion-at-point)
=C2=A0 =C2=A0 )))
--8<---------------cut here---------------end--------------->8---

You could use a similar (and much simpler) approach to get what you
want.

HTH,
eric

--
: Eric S Fraga, with org release_9.6.4-335-ge065b5 in Emacs 30.0.50
--00000000000068673f05fa66f969--