Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imenu-list no need display class name in c++ #22

Open
code-moritz opened this issue Apr 28, 2016 · 1 comment
Open

imenu-list no need display class name in c++ #22

code-moritz opened this issue Apr 28, 2016 · 1 comment

Comments

@code-moritz
Copy link

Like below pic, in c++ code, the imenu-list show all of the class method . but the every method line, The head add the class name. it is no necessary . If it only show class method in the class tree , it is better.

image

@bmag
Copy link
Owner

bmag commented Apr 28, 2016

Interesting idea. Currently, imenu-list shows the entries that it receives from imenu without changing them. We can change the displayed text of each entry by using a transformer inside of imenu-list--insert-entry. The entry's text is obtainable via (car entry). Imenu entries can have different formats for different languages, or when using different minor modes (e.g. semantic-mode), so of course the transformation needs to have some context. The variable imenu-list--displayed-buffer provides that context. For example, here's a way to check if we're dealing with C++:

(eq (with-current-buffer imenu-list--displayed-buffer major-mode) 'c++)

Patch welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants