From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: [FR] Allow flattened imenu index (was: [PATCH] Add new option 'org-imenu-flatten') Date: Sat, 09 Dec 2023 10:57:15 +0000 Message-ID: <87msujskxg.fsf@localhost> References: <87plzgbalt.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2208"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-orgmode@gnu.org, 58131@debbugs.gnu.org, emacs-devel@gnu.org To: Morgan Smith , Eli Zaretskii Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sat Dec 09 11:55:09 2023 Return-path: Envelope-to: geo-emacs-orgmode@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 1rBuzE-0000K8-Ry for geo-emacs-orgmode@m.gmane-mx.org; Sat, 09 Dec 2023 11:55:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBuyL-00011E-EI; Sat, 09 Dec 2023 05:54: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 1rBuyK-00010u-1x for emacs-orgmode@gnu.org; Sat, 09 Dec 2023 05:54:12 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBuyH-0001zp-Tn for emacs-orgmode@gnu.org; Sat, 09 Dec 2023 05:54:11 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CE081240103 for ; Sat, 9 Dec 2023 11:54:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702119247; bh=ZuNpkRjYhPUJpaMYPXINlGjvsjX80FyJwhMeES43vFI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=lBD5BFNALB6Wf9Wfg7O2oreRZ6fLYUkVjVECIsrEGCWaJADC8hZAvhsRnUp40BxQr sEKrvCzjSG1Ij4/t8rEekRPih58Rhe6FIu/oSojTeqIswt2fUUCUs/6L7sf1mCxZV3 VQ5hGs9eKDxPsg/LgdxM95hl7DIJXK4HDeSZnqn/XRMVs4YxazF70Z0yqT6p21zvTk IBekrGK4nWJmWu481oF7GprFUyL08rjYfy0oxSj7qs7WJGK1GOEs4duCBgGGOhuMYP sfKGo5QEaHoHMchCFnaHUdzmIeaw1yfuND8RuzVNu0YeUW0uiopNigGAUuVMB2exPZ yWOx+wBzv/9xg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SnPyR1TmFz9rxL; Sat, 9 Dec 2023 11:54:07 +0100 (CET) In-Reply-To: Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.orgmode:158501 gmane.emacs.devel:313631 Archived-At: Morgan Smith writes: > Ihor Radchenko writes: > >> Have you considered adding a "flatten" option to imenu itself? >> That way, you could automatically get the functionality for free >> everywhere, not just in Org mode. > > I have considered that but gave up with minimal investigation because it > seemed harder then this solution. It's possible imenu did actually have > this functionality sometime before 1998 (see commit > fe2908be7b09f4c765ebdaf16fe07b0a77f78ba8). > > The doc-view imenu-flatten stuff was added 2022-09-28 (see commit > fe002cc8ce38efb256a2a60660ee626c2b2cdf81). This makes me feel like > maybe that person thought adding it to imenu directly would be hard. > > I might at some point investigate doing that but likely not soon. Also > if that feature was ever added, it would still be compatible with the > patch I sent. For those reasons, I advocate my patch should still be > applied even though it is clear that it is a sub-optimal solution. I'd prefer to ask Emacs upstream first. We are discussing adding a new feature to Org imenu - an option to flatten the menu, so that all the nested index entries are displayed at top level. This feature is also present in doc-view via `doc-view-imenu-flatten', and in python.el via `python-imenu-create-flat-index' I am wondering if it makes more sense to add this "flatten" option globally into imenu instead. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at