imenu-list icon indicating copy to clipboard operation
imenu-list copied to clipboard

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

Open code-moritz opened this issue 9 years ago • 1 comments

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

code-moritz avatar Apr 28 '16 11:04 code-moritz

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.

bmag avatar Apr 28 '16 15:04 bmag