jump/show items that have items underneath
Thanks a lot for side-hustle.
This is a question/request, not a bug. If we open a file with nested levels, RET and SPC expand or contract the menu underneath, instead of taking you to or showing in the other buffer that specific heading.
From looking at the code, I think that is because of the call to side-hustle-show-hide from side-hustle-button-action. My elisp knowledge is rather limited, but I wonder if it would be possible to have functions that just jump/show that item without expanding/contracting (e.g., maybe something like side-hustle-unconditionally-goto-item , side-hustle-unconditionally-show-item, respectively bound to S-RET and S-SPC). I tried modifying side-hustle-button-action to see if a quick hack would do, but it didn't.
Maybe the problem is that imenu is providing the items in a way that does not make the behavior I want possible (using imenu directly, or via helm or consult does not allow the behavior I want either). So maybe I am asking for something impossible.
Thanks I hadn't considered that some modes specify headings with children in their imenu expression. Leave it with me.
Thanks for considering it!
Is this for Org-Mode? I did some investigating and the problem is that Org does not provide the position for the Imenu parent item in a way that Imenu understands. I would say this is why it's not working in other modes either.
I've noticed it in these two cases: org files; pdfs with outlines (shown with pdf-tools). Now, for pdfs with outlines, I just realized that SPC or RET in the lower level do not do anything (on upper levels, it hides/shows them). Arguably, pdf-tools has its own way of showing this (bound to "o"), but if I trigger imenu manually or via consult or helm, it does seem to work. But I think this is a separate issue. Should I open one for this?
For org files, I guess if Imenu does not understand what org provides, there is nothing to be done. And for pdf files, as I said, pdf-tools as its own built-in tools.
So maybe we should close the issue. (I tried using side-hustle, because it was intriguing trying to use the same tool for many disparate files ---it works great in LaTeX, R, Haskell, Stan, Emacs lisp, ... :smiley:).
Looks like I should update side-hustle to just call imenu on the sidebar items. This will make it compatible with any mode that provides a well-formed list of imenu items.
Was any of this better with v0.3.0?
I just tried it (specifically, side-hustle-20240625.1228) . SPC and RET with pdftools and org-mode, on the lower level of the hierarchy, take you to the item. (On higher levels, they expand/contract, which I think is the expected behavior. Thanks a lot!