From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CLg2CRKXS2RukgAASxT56A (envelope-from ) for ; Fri, 28 Apr 2023 11:51:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qCgSCRKXS2RHdAAAauVa8A (envelope-from ) for ; Fri, 28 Apr 2023 11:51:14 +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 0D84F118CE for ; Fri, 28 Apr 2023 11:51:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psKkK-0005bj-Ty; Fri, 28 Apr 2023 05:50:32 -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 1psKkJ-0005al-0O for emacs-orgmode@gnu.org; Fri, 28 Apr 2023 05:50:31 -0400 Received: from mail-he1eur01on0705.outbound.protection.outlook.com ([2a01:111:f400:fe1e::705] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psKkG-0000UE-0H for emacs-orgmode@gnu.org; Fri, 28 Apr 2023 05:50:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROEOlMkadV16WiGcvtsimA/ahZ0EnCLlXYbqEsVHZPOZMy2bywuezsTeBb0vBCxtWS3decaLiVlbj91oXOas8vuTN4meS3l77FQxEQquE44oRLQul1xOt0H4HPy7Qq6xKXJORjdBbN48NxhBn2dgWjqfWdGWB4qiAJVXSWjwe+bFrahgrVTxyPYl5Splfo/no5VRMziUenxjPRo54QciRxKc4xGymv1/UNHbz9veSiNI/EdJXPC8bYDutOh6xmRh3lvGmvwPpsadgn/YdjLJqf9NFn2IdmHsAra+FY+YiRoSfhCVvpLqNcmfB0meVFvvWgJtSXefB6WHld4IjYugeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qbMndp+nh/h5cItsnkbN7CosSKQwUJkd4Szt8sic6yk=; b=OXGBEqyUtVeqv1V8bq20bT3PuIy7s382Kgqb81eyvsbbFFd91aSqrp9i2AtFlyfGHRjyqJNPcCtJdBFV/zVk9hM8PY2BjsC2iGbOtbQkCGs6uhcnse2QhW+QPnLuD+Ee2/CE93/7c1k3s4xhm80m1t3FKt1VS/k02YW/PfS5ielXrWK1veNMJwE5F6fj9QtYbZpf67oRAA55v19xKzM8QSNHdxv0EFdhFjHctWtLCy4odfiijOqYfAkpDM+4UOUHYluhmgVoxuusV4rBneWY3jugmYR9baPK1y+mhYrOWX6hplWvWhRmhq6jjC4gpvLcEwYj9EGMSo2xM5ZHtuxuQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucl.ac.uk; dmarc=pass action=none header.from=ucl.ac.uk; dkim=pass header.d=ucl.ac.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucl.ac.uk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qbMndp+nh/h5cItsnkbN7CosSKQwUJkd4Szt8sic6yk=; b=biFM6H277yIK2pE/OxaVsLzA60NxrbCsVQhtX3BtXb8ExJJu5VzFY5m1YcIumfmVWuv1iRWEFmmLEFR//4CcJGPJlNl8roQC5kgnFAix7bBvpVoy/IJTgcP7MHgp7R2LNA8pc6ytkMUpwPQ9jxBHqiU//xUqoh0w1kqodF1ZcTU= Received: from AS4PR01MB10249.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4fa::21) by AS8PR01MB7176.eurprd01.prod.exchangelabs.com (2603:10a6:20b:23b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.23; Fri, 28 Apr 2023 09:45:21 +0000 Received: from AS4PR01MB10249.eurprd01.prod.exchangelabs.com ([fe80::d12e:cb10:5bce:85eb]) by AS4PR01MB10249.eurprd01.prod.exchangelabs.com ([fe80::d12e:cb10:5bce:85eb%6]) with mapi id 15.20.6340.023; Fri, 28 Apr 2023 09:45:21 +0000 From: "Fraga, Eric" To: Philipp Kiefer CC: "emacs-orgmode@gnu.org" Subject: Re: Suggestion to increase usefulness of TAB key / 'org-cycle' function Thread-Topic: Suggestion to increase usefulness of TAB key / 'org-cycle' function Thread-Index: AQHZea6xVBdwRvgSw0uPoiMsP3wprg== Date: Fri, 28 Apr 2023 09:45:20 +0000 Message-ID: <87cz3o2vdb.fsf@ucl.ac.uk> References: In-Reply-To: (Philipp Kiefer's message of "Fri, 28 Apr 2023 10:49:17 +0200") Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: gnus (Emacs 30.0.50) x-url: http://www.ucl.ac.uk/~ucecesf/ mail-followup-to: Org Mode List x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS4PR01MB10249:EE_|AS8PR01MB7176:EE_ x-ms-office365-filtering-correlation-id: c4fed8ba-baac-49a2-8d73-08db47cd484d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s7yYaJX0GgGIyLzLcuwZbWTEOfmngiqt5JrIadsy+Sh4dhA4HX6f0+1+6wX7zKIyBVLkCtgcj7IRFCOtlkYz6e5dWftxTj1yTbae3YCKEuiaQNV1JBCz0Rkc1GYrmEBxF87tuMhw3DghXYIcMLfAuXibO0JFZ++DUFPZyLDH0mlsu6KjkRpW+hXhxCnZVWzsjonzi6a91+a0Q1ENRPC45NxE7+l9CwNS0/kg4LlgMHgEWORtU+FncnUlwNIspBecfL+s0lScuTIbEmTB4uyQ5ziWSPtZcDwbcMHVbCYbIF4zRnBuj+bEq6Vlyf9u9KBJkwX42bZiMFPBJj4cQdEq//TbVmLRe70yvFLc6lNXJeu2RzNWIo4kroWUK46KHFQAfxAzpoGmkRD1TWVCcJK/9KI84FMQI2KT0Tk9SMax8FnaSUYNVsdVnlRLMS1YjV91bfYgW4+OMdDLsloN3Xa/tYSDJYq0Lf5CLwSiIcpGdm/ZvM/UkJg88jPopAsRv1ACWAlVPlR30nm2pbiOu/0UA49DgD58DZpArNSX/UhrMBSrgBrFTk7W3JoAFTLyHzEy7nU+49ax9HluC02hvKPSuFwlddvmZXwUKsrmRN8cpOg4Fv9srfVU7EibJyyNE0Pl x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS4PR01MB10249.eurprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(366004)(376002)(451199021)(4326008)(6916009)(66446008)(786003)(316002)(66946007)(64756008)(66556008)(76116006)(66476007)(8676002)(8936002)(5660300002)(41300700001)(26005)(66899021)(478600001)(91956017)(2906002)(6486002)(71200400001)(6512007)(6506007)(2616005)(36756003)(83380400001)(38070700005)(86362001)(38100700002)(186003)(41320700001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-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UbowmhtmCxiG16Xwa2IAl?= =?iso-8859-1?Q?zk7kLxD/6b+y+6dmHoYIOt00BpPwS4xzQ1cjs9eF8rbFU6whv4S23AzeI2?= =?iso-8859-1?Q?M6Wz6p96990P1CrAfGpARPSMlu+vdlBh72xTcV5XdkkbQzfZrNOCU+Xg17?= =?iso-8859-1?Q?itgbWP+yDGNlUdWoat8SuOVP4y6L+c7kKKK+18/abfZhJUKOpf8/onAANp?= =?iso-8859-1?Q?XHUR5IqScpBojwBrB6aPVf2hLDKI9qFjWkmyUm8xPKnSQC0SwnYGaaaKdg?= =?iso-8859-1?Q?gCilTeCCdpfQ1QQkHNxpX2HayilN/0lfxxtdqsoF6x/6NE0yiuPXv3shYH?= =?iso-8859-1?Q?/quAketctsQxmKLXnEP5LQo7Vt1+eBTfjr6d/goauFxILMhouOHopLiUBn?= =?iso-8859-1?Q?GsnScFReiwyrPlWeCR7X1eO3m3Hqn5aqzJiJVHOliSDtdey7N9oUzp52se?= =?iso-8859-1?Q?fqjgAHSrgAZOiQKOgsYNpbSS0O6acKHC9KwISQP9Dz9qYpC2ufXkmsR21I?= =?iso-8859-1?Q?ZFS1CX2hYs/EBvt2Ee4Yl82bgjlIfHxFQBl0+mDaEdXDvpKATG47EQmYno?= =?iso-8859-1?Q?2mHJqqKzS7hW28NzJ6uKMx9FHRewxQ0O0ww+MOlISfRLtbC8qNRA3mKoBB?= =?iso-8859-1?Q?o7dBM9qMTloEsIm4wNJVacUiXDnfYmxZKINCxkoIHEWfRbDKuEZtL7meFB?= =?iso-8859-1?Q?CY2SQBTnD4xv6SNJ/rz0AO01HuAsDGx0jhW8d+dSYbbzMvmYqIlfwj0Fr5?= =?iso-8859-1?Q?7xW4Lrms6l6m2hJ4I3nMVdWpoaLaKJT2is?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: ucl.ac.uk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS4PR01MB10249.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4fed8ba-baac-49a2-8d73-08db47cd484d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2023 09:45:20.9952 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1faf88fe-a998-4c5b-93c9-210a11d9a5c2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fQmbFPIoA37DOZDs32RW62o95EFOSH9zgNjy/4IbnyxnxrS9ppkLvrEz2qBBawm+u1gSOo1ZiReo+XoF3IRVsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR01MB7176 Received-SPF: pass client-ip=2a01:111:f400:fe1e::705; envelope-from=e.fraga@ucl.ac.uk; helo=EUR01-HE1-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-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=2; s=key1; d=yhetil.org; t=1682675473; a=rsa-sha256; cv=pass; b=jAnMdwcyYANghzYPGcq8l26doN41zkOszp0eZ5x+U54ecaMWjytEM5o+r8eAP+N4HjE8kT ySEBOABctJPkXh11GpeKS9tPkloccWb1lgKpuTdeG0fv9pISYOGnKyIGdO7v3ClTRoRIx1 WsJXVNSyyQUjQL4/lBgspHDB1KD4HPvygNavQrEgh9ZNxroLkTuEKzSXNmI84EYXre6pEY snplFVv0zw6W19bU0jWGznFBeEfy/ZAbWPR9ZG3+5wPKF9XYn0a+SPcclUAgRuYc6PRVfW eUxH4qpkf5S49PTeV8i5A4wvdg4ytufE9sSU82qlMcrwYwnZ6QI1Nyv8ZlCKUg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=ucl.ac.uk header.s=selector1 header.b=biFM6H27; dmarc=pass (policy=none) header.from=ucl.ac.uk; 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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682675473; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qbMndp+nh/h5cItsnkbN7CosSKQwUJkd4Szt8sic6yk=; b=gviXS9MPKJhgA+m4XN0zw8pP3d9wptvEzya/lmk7uyh2i4dFLXNfttrBqsnnvtoI6QjOvu caIC+1UkVr7WzwMKFYKKw41LGgHeUmmdyIgi/ZLeEhOlKXUFDm71fRY7qJjcBpzowcd2XF WAltqPpqLK6yNWa5v3vxJxRzaRoG7XwRxmdMCzluzwJH8mUOaQejzkXKDCS9yDppmVhE+Q cTdCFLOOJqTId5klI37+IHQlOk2vOpI5AN7xfhyZzYVKFbVMTO0WHeMZWif9GKkUgkMK1T jUxAZjwiYixH0emktx5xAQJ/0qApzQ16V7AG9tRLLxZwzDl9aW6b92d7SDxiyQ== X-Migadu-Spam-Score: -11.09 X-Spam-Score: -11.09 X-Migadu-Queue-Id: 0D84F118CE X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ucl.ac.uk header.s=selector1 header.b=biFM6H27; dmarc=pass (policy=none) header.from=ucl.ac.uk; 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=pass ("microsoft.com:s=arcselector9901:i=1") X-TUID: mHRlpQHNnayL 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.=20 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)= ))=20 (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 ta= ble 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 --=20 : Eric S Fraga, with org release_9.6.4-335-ge065b5 in Emacs 30.0.50=