branch: elpa/rust-mode
commit c69adaf8ea5b2bdf56d7ae9a54a0a86b28fd9418
Author: fmdkdd <[email protected]>
Commit: fmdkdd <[email protected]>
Add menu titles for items in imenu
All items gathered by imenu were put at the top-level, except impls.
This commit puts all items in separate menu titles, following "Impl".
Fixes #93.
---
rust-mode.el | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index 65fc1fd..16aaa6d 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1195,16 +1195,15 @@ the desired identifiers), but does not match type
annotations \"foo::<\"."
;;; Imenu support
(defvar rust-imenu-generic-expression
(append (mapcar #'(lambda (x)
- (list nil (rust-re-item-def-imenu x) 1))
- '("enum" "struct" "type" "mod" "fn" "trait" "macro_rules!"))
- `(("Impl" ,(rust-re-item-def-imenu "impl") 1)))
+ (list (capitalize x) (rust-re-item-def-imenu x) 1))
+ '("enum" "struct" "type" "mod" "fn" "trait" "impl"))
+ `(("Macro" ,(rust-re-item-def-imenu "macro_rules!") 1)))
"Value for `imenu-generic-expression' in Rust mode.
-Create a flat index of the item definitions in a Rust file.
+Create a hierarchical index of the item definitions in a Rust file.
-Imenu will show all the enums, structs, etc. at the same level.
-Implementations will be shown under the `Impl` subheading. Use
-idomenu (imenu with `ido-mode') for best mileage.")
+Imenu will show all the enums, structs, etc. in their own subheading.
+Use idomenu (imenu with `ido-mode') for best mileage.")
;;; Defun Motions