Subject: bug#58431: 29.0.50; [Eglot] Add "breadcrumb.el" feature based on imenu.el/project.el services

From: Yuan Fu <[email-masked]>
Date: Wed, 17 May 2023 14:31:14 -0700

> On May 12, 2023, at 6:09 AM, João Távora <[email-masked]> wrote:
> 
> On Wed, Oct 12, 2022 at 12:49 AM João Távora <[email-masked]> wrote:
> 
>> Let's use some M-x artist-mode magic to explain what is in place
>> and what I am proposing.
>> 
>> +---+----+   +---------+     +----------+
>> |eglot.el|   |python.el|     | ruby.el  |
>> +---+----+   +---+-----+     +----+-----+
>>    |            |                |
>>    |            |                |
>>    |            v                |
>>    |        +----------+         |
>>    +------->| imenu.el |<--------+
>>             +-+--------+
>>               |
>> +--------------+
>> |
>> |  +-------------------+
>> \->|which-func.el      |
>> |  |(already working)  |
>> |  +-------------------+
> 
>> \->|...                |
>> |  +-------------------+         +--------------+
>> |                                |  project.el  |
>> |  o-------------------o         +--------------+
>> \->|breadcrumb.el      |             /
>>   |(proposed addition)|<------------
>>   o-------------------o
>> 
> 
> I've now created https://github.com/joaotavora/breadcrumb with
> exactly this architecture.  Suggest everyone interested
> check it out.  Propose we add it to ELPA.  It is not
> Eglot-specific so it needn't depend on Eglot (but I've tested
> it with Eglot and it works well).

Looks good! It doesn’t seem possible for a major mode to give breadcrumb a custom “imenu-alist” that’s different from what it gives to Imenu? It might be useful because it’s common for major modes to add a category layer in the imenu alist, like Function > xxx and Class > xxx instead of xxx along; and there might be other reasons the major mode want the breadcrumb to be different from Imenu.

In general it might be useful for breadcrumb to have it’s own interface, with project and Imenu adapters come with it out-of-the-box.

Yuan