From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uFKjEHoycmWj6wAA9RJhRA:P1 (envelope-from ) for ; Thu, 07 Dec 2023 22:00:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uFKjEHoycmWj6wAA9RJhRA (envelope-from ) for ; Thu, 07 Dec 2023 22:00:42 +0100 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 CD1BB5BB69 for ; Thu, 7 Dec 2023 22:00:41 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b="QL/6ZYYG"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=outlook.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701982842; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=vtDPwmyItdBB4rvYcl8v3k6G0J2XWGuxdrznSDdc7NQ=; b=luWz8MvRerjGAs5i5lKgfLHLyMB9su1C8JuNECKOxxhcEN+paxMW5AxK8eGy3UcLbS2leD OgkcogliuKggUALSM8LAEjKGnzg4s/vGXEJfkPLzkd/CgajPBBGdd4PwmOTacYiBLrQNKe yG+U1UA1miy/STyoI3CVXzdCrp9+87+VaMQCqehOLN5B+aMTYAGLNSPbDlFwsLKV6+kMOt EnqDdPWsWQlW3TIdqJdTZ3rlwLpB5F8PLkywMmrjc4hubYaQOqAoZVXL1+YCgL6QQM3HKi l3kneNYqhiAaP3d84nH1d0FK8TTnMsGOElR9Jsj0FJKu82dcx/fHxgQXkTYsRA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b="QL/6ZYYG"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=outlook.com ARC-Seal: i=2; s=key1; d=yhetil.org; t=1701982842; a=rsa-sha256; cv=pass; b=E66bAyCyRmCFtNpkizHQQkEeBBbSCOib3fTSJAXU9fj5waLjdjHN8/LH/AjrHT/4rcSgNz u97ffrOGynisApFRQFR0XlKor38ns6VDIyEDrAyRnTokE9v+LMbHUBzCZg37DzmssP3Rxz HpODGyf2eGdLxjyF1JyhIEo5VBwwizx7Fc7ifdKL+PH9XRqhI8LFrEmNX73wlbCwNiy8IM TMHOnBK7g/4a0QKm3zXGMsFOMOvaWnljdntJDSY1LU7t6Jds/j4wS763bZRQJUuJm73CWQ MzFXTbzyyHa75G02SE89zY/LWFoO+XlZBMKHNHkZ8I0xAsV2h9cSOvjf8iS/bQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBLTA-0000iN-Ku; Thu, 07 Dec 2023 15:59:40 -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 1rBLT8-0000iF-JM for emacs-orgmode@gnu.org; Thu, 07 Dec 2023 15:59:39 -0500 Received: from mail-sn1nam02olkn2081f.outbound.protection.outlook.com ([2a01:111:f400:7ea9::81f] helo=NAM02-SN1-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 1rBLT6-00031o-Ev for emacs-orgmode@gnu.org; Thu, 07 Dec 2023 15:59:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1nUjiwZRFAoihkCFHynIKizdCWCXE0NDSudmqAPZNMeyIxniPGOklzk/obCUYS01syBBEBPwxhcClLieOc6RbW/6+rzVP6jgj7N4xXj09udYwnxvdK8pdZquoD3tQRKFwFKetbWwjtBXxtJ5h9HQYu2nyf6SU4wNFmE53jlT2CveExdOeHtCyQvxTagxYVJTtii5DKHkAaWR+GCyk1Sa3in7B5D+rfHlhBYcZQPJS6nKPunUv6AZlHYKyubSvXqcRIYLBkhI2v6bPW1d43+vXtYJkwnujq5369GnjEnBxqW7nQeBflZGh/K7BlDizzNsdbTlY60sVcSvpzb2gLWcA== 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=vtDPwmyItdBB4rvYcl8v3k6G0J2XWGuxdrznSDdc7NQ=; b=jcWk9IEp+gT+ZDdX+t6WD3m+C2cuDalkgjtAks4jTbA4DAu/Yql7nH9Ih6Ylkb6Eon/kYzJHEOhihJMkFlrXOkMMIcY+Iq+rxctn0zBIZTtVmdRye8VdVuC4TAapiGtxSO1lkNZzGUv0lEnaKAb5hrhtjZWwu2jzsEQTF5uJCpNKonuMOrkwFxelWeOF+rpCwcpl15AyIOvX5AXXw7hkPq7+NNGZXwUGOdwxsaonUNceJzRC8FEqIY//Jwqo6peY4votvlay83BA7NVZ3BY+6tJyHZNGrMa9kUqGdvkLcsNf1OSltRLUzTezfaU3QNFLq21orZxhThRKN7wexSP5Ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vtDPwmyItdBB4rvYcl8v3k6G0J2XWGuxdrznSDdc7NQ=; b=QL/6ZYYGm9W7NNyD74wXaj9brB3/JK9T9NmqvQ69bbFMolrVx63Yi9wJZTbehv5YVpIdoWqnSw3n1YaN0Pde+noqTr1mt17ZbI+YapZLDvKWLnLRG3OIH9RnQED3FcHD7iDKaNkYv8LtX99QwdwqfLvS7Nrp/5RL1k7emnZaQDFidIF6qkQb3qxTpNQCtRYPUi6HbBDToTU0dH0ndQsS0NqTZHkwFfkZc2cOZMu8krV7CnIQ8FFIj18fPGMJDz2C7gXMCccNaA24cJsRgTkDkI4OCn+DmdiwTQaWWWJl2qUmfXeChoNI7bCrXjrM01jRGtzzUesGGb3iDkEQCpJpBg== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by SJ0PR84MB1676.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:a03:433::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.27; Thu, 7 Dec 2023 20:54:31 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d3da:3eb4:4e7d:440c]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d3da:3eb4:4e7d:440c%5]) with mapi id 15.20.7068.025; Thu, 7 Dec 2023 20:54:30 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Subject: [PATCH] Add new option 'org-imenu-flatten' Date: Thu, 7 Dec 2023 15:52:26 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [1Zztnx9kZLVtz5a/yu9Wf406Q73C9HbgyzVeN4igA5o=] X-ClientProxiedBy: YQZPR01CA0121.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:87::9) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20231207205225.2893-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|SJ0PR84MB1676:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f8e93f8-0801-4e58-2134-08dbf766b564 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6shBBXE6LpYJgvisCfODQK89tw1NU1N/R4JfC3cayqA4O6ADnZQjJw08I3LZeJ05OLT01gufvLUihv0tYNCVJwR9yDCBTUfK/GeTSYtg+q1zv1v9WSz839pu1ZODuj3rnsv+ekOCJbbQs0xbZjNlzunBJk8JhNpxC4ogsanE3BLih7qjsCIQWJgnBH0JvEi59JC1i+hJ4WqMzL4981MCdIzauqOno158hF/4Zj4kFdjG0CbR2OzDQRtY2hD/wVindYsnIwIc93SOxHllkVcINee/s5buVIUY5SJsOzKrJ5d5ME8yReh6KIHrkduf/MuzwH1AhkYhvSPK/BMU1X9SGsP6zGfiDphfWeLrqiDf2D05133FSGM3d8PGgfpbyPg8Rj/CWa+5wVjVNgU8OXhbbddDev4MdO5HkD0KfUR9ABLaf/clUYZ+6wxK0r6OpT0mHGugAPBk97Zbi3amu1KtuGb8Stkylf2d3d6a+dDGO02EFKRHhTWLlOhuhpIcWMJu2QrHbTWD27NLQyiRaVaFcWgRbTJ2IZkVyBMMR1XZzxdqHm/M2g2yxrNkDrIt26wp X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?i0XMq3DxX5hQ4f4N/VTPw2QY46/GaTO82TW25j3ZVBy99VCGgyXhwzVh7vL+?= =?us-ascii?Q?LeSQGV9YNMS9I2moPEsJTVAcPU8h+y7mDZhtiHozeHDSzH+nM+7nzGis2nzr?= =?us-ascii?Q?CjUGYBoKQIQajP1oWzwMF6+KEVyoZtSvai6YLpd9vOtaeVdHwn2qdLAi5VEi?= =?us-ascii?Q?3pC9XwWeJVSxtuUO53wi9n7ftEE/TQbws//WQPgl6B7bQV/VkXRtXzi4HrN7?= =?us-ascii?Q?ULDWCJgGM/hXE2iylW+ReR+N0bA+gHbf5RF12vRvqvOCjj1zbiiJUVZcgxpJ?= =?us-ascii?Q?OXAQQHdCFkevpOIdXmnxhoRA6nL8lC50DSvAsnA8rJHU27krK5gi9lIy5YY4?= =?us-ascii?Q?J2sWAiIc/JjV14Az378lKk4pvTsmR55dTXRKEa2D2GFFtyBBa+ddpyIo4f6g?= =?us-ascii?Q?F/pr+/x+OVzz+oo1LaHDFyLdWUb317A2z8QPU7xXwTfH4EG1M6ibW46t3x/1?= =?us-ascii?Q?WK+Ny2kpsdP1OV5r5ZQWmqfOmiHxBWjYiib5xLQPyRdqWd7CKbKw9End/L/X?= =?us-ascii?Q?mKm0BTej4cXKABXlouscD00wRAwwZxa+NuN6TTwJtrrcVGnjqZns01/9lS72?= =?us-ascii?Q?/uK3L+5Y3g8RqQ8wnUwmstdfg+lyMBN3AHe8BPFpfcTyPbtaPHzs0vSSfmSN?= =?us-ascii?Q?UAyPgotJg1WIrzvmBhfHw1pshdRfBAYDroYRLKbQBy/N8zML0f4Hy37IPaDz?= =?us-ascii?Q?Y/uHQYc5WVhdjMw9+2GiDZ04QyOg/nh1myRjyyOehmCtDSK6RvMdAAfMiIe5?= =?us-ascii?Q?/nft8HpSxWtLpKWCOzTHvydXc03tiA5C6woEEVpV0BPg50pO4bGjq3WvGXm3?= =?us-ascii?Q?xPfo+89r6jTZLAjAWfY91uPjO4A1NiME/MSnEkNXzPLcOPpqnu5zQBEF2l8v?= =?us-ascii?Q?HKsAKG9+U9NcMkmrOd3WzFjiWiJx8+GIo5YYs+eIrvMcMSKh65d+I0ZuQxQA?= =?us-ascii?Q?Y8C3RCLD8CfEjznNIfteWNZlp9Nz5ZG1szY8a2Yz7BHTEg0Lh7sKSXrTL/D+?= =?us-ascii?Q?ODZVrNeEOJ0RyCoJdjGOc5IVer36IcdOH4edSzf1yA9vECCpgoao+CynYxMQ?= =?us-ascii?Q?EqUnkgA6Col/gIbVpyy9zYebqFSLt8fl3y/0FsXceASgS7Gy9QEXbfOBbCxO?= =?us-ascii?Q?gmJZl0SKN4ambuosXVAf2Xd/gwTx1osDwC/0C7/98TcfueOeEzdAWf9xpeA8?= =?us-ascii?Q?IqAdOeEoWiOCKoo1zA5f6ebks87e+I/gbeJjO3N+ROmvnJCiYLOe0F93YrU?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f8e93f8-0801-4e58-2134-08dbf766b564 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2023 20:54:30.7012 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR84MB1676 Received-SPF: pass client-ip=2a01:111:f400:7ea9::81f; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM02-SN1-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, FREEMAIL_FROM=0.001, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.20 X-Spam-Score: -9.20 X-Migadu-Queue-Id: CD1BB5BB69 X-Migadu-Scanner: mx12.migadu.com X-TUID: 43xwO3bXJ/fL * lisp/org/org-compat.el: Add definition of 'org-imenu-flatten'. (org-imenu-get-tree): Use 'org-imenu-flatten'. --- Hello! I've been using this patch for a bit and I quite like it. One would think there would be an option in imenu itself to flatten trees but that does not seem to be the case. I copied the defcustom from 'doc-view-imenu-flatten'. Thanks, Morgan lisp/org-compat.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 2697342d6..f2112e4e9 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -1333,6 +1333,10 @@ Pass COLUMN and FORCE to `move-to-column'." This also applied for speedbar access." :type 'integer) +(defcustom org-imenu-flatten nil + "Whether to flatten the list of sections in an imenu or show it nested." + :type 'boolean) + ;;;; Imenu (defvar-local org-imenu-markers nil @@ -1353,7 +1357,8 @@ This also applied for speedbar access." (org-link-display-format (org-get-heading t t t t))))) (when (and (<= level org-imenu-depth) (org-string-nw-p headline)) (let* ((m (point-marker)) - (item (propertize headline 'org-imenu-marker m 'org-imenu t))) + (item (propertize headline 'org-imenu-marker m 'org-imenu t)) + (level (if org-imenu-flatten 1 level))) (push m org-imenu-markers) (if (>= level last-level) (push (cons item m) (aref subs level)) -- 2.41.0