[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 80f2019 261/346: Don't nest imenu to arbitrary dept
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 80f2019 261/346: Don't nest imenu to arbitrary depths |
Date: |
Sun, 29 Aug 2021 11:00:42 -0400 (EDT) |
branch: elpa/d-mode
commit 80f2019692689a38ca5b96e7388d4fe614602323
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Don't nest imenu to arbitrary depths
Even though helm-imenu seems to support arbitrary levels of nesting,
imenu itself (i.e. imenu-add-to-menubar) does not.
Revert to the old hierarchy in which the first level is used for the
leaf symbol type, however, keep the hierarchical data in the form of
using the "fully-qualified" (a.b.c) name for the imenu item titles.
---
d-mode.el | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index b3d503d..1611542 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <russel@winder.org.uk>
;; Vladimir Panteleev <vladimir@thecybershadow.net>
;; Created: March 2007
-;; Version: 201909120344
+;; Version: 201909121403
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -913,23 +913,23 @@ Each list item should be a regexp matching a single
identifier."
((equal name "{")
nil) ; false positive with decl-start keyword and
{...} group
((equal id-prev-token "enum")
- '("[E]" t))
+ '("Enums" t))
((equal id-prev-token "class")
- '("[C]" t))
+ '("Classes" t))
((equal id-prev-token "struct")
- '("[S]" t))
+ '("Structs" t))
((equal id-prev-token "template")
- '("[T]" t))
+ '("Templates" t))
((equal id-prev-token "alias")
- '("[A]" nil))
+ '("Aliases" nil))
((equal type-prev-token "alias")
- '("[A]" nil)) ; old-style alias
+ '("Aliases" nil)) ; old-style alias
((memq next-char '(?\; ?= ?,))
nil) ; '("variable" nil))
((member name '("import" "if"))
nil) ; static import/if
((memq next-char '(?\())
- '("[F]" t)) ; function
+ '(nil t)) ; function
(t ; unknown
(list id-prev-token nil))))
(kind (car res))
@@ -937,7 +937,7 @@ Each list item should be a regexp matching a single
identifier."
(paren-state (when res (c-parse-state)))
(outer-brace match-pos)
d-context
- d-fqpath)
+ d-fqname)
(when res
(when paren-state
@@ -947,25 +947,20 @@ Each list item should be a regexp matching a single
identifier."
(setq outer-brace (c-most-enclosing-brace paren-state
outer-brace))
(setq d-context (gethash outer-brace d-blocks))))
- (setq d-fqpath (append d-context (list (concat kind " "
name))))
+ (setq d-fqname (if d-context (concat d-context "." name) name))
(when have-block
(goto-char decl-end)
(when (and (c-syntactic-re-search-forward "[{};]" nil t)
(eq (char-before) ?{))
- (puthash (1- (point)) d-fqpath d-blocks)))
+ (puthash (1- (point)) d-fqname d-blocks)))
(setq last-spot (car decl-or-cast)
d-spots
(cons
- (let (res)
- (mapc (lambda (e)
- (setq res
- (if res
- (list e res)
- (cons e id-start))))
- (reverse d-fqpath))
- res)
+ (if kind
+ (cons kind (list (cons d-fqname id-start)))
+ (cons d-fqname id-start))
d-spots)))))))))
(nreverse d-spots)))
- [nongnu] elpa/d-mode 203ef14 335/346: Don't call easy-menu-add on Emacs 28+, (continued)
- [nongnu] elpa/d-mode 203ef14 335/346: Don't call easy-menu-add on Emacs 28+, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 80fad30 345/346: Merge pull request #108 from CyberShadow/github-actions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e42c1c1 340/346: Implement r"..." string literal syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode dee393b 228/346: Fix setting the mode menu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ac898c0 245/346: Fix parsing of scope-statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 459732e 243/346: Fix parsing associative arrays in function types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 362be11 250/346: Fix imenu false positive with e.g. private{...}, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ea32e73 264/346: Makefile: Test byte-compiled version, too, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 979c946 256/346: Fix testing multiple nested imenu entries, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8ffe5ac 265/346: Remove doxygen-font-lock-*, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 80f2019 261/346: Don't nest imenu to arbitrary depths,
ELPA Syncer <=
- [nongnu] elpa/d-mode bdd5d78 281/346: Replace d-forward-decl-or-cast-1 implementation with a custom one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 02d1c7f 290/346: tests: Add more binary operation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 09ecdaa 303/346: Add "make coverage", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 166fac8 313/346: Fix fontification of second foreach variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0d45ab2 315/346: Fix brace stack logic creating unbalanced stacks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 55c8cb0 306/346: Fontify types in function parameter lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c22a8c1 309/346: Fontify variables in foreach loops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3731f1b 316/346: Fontify built-in @-keywords as keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e70d89f 312/346: Fix fontification of catch statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2f7adb1 319/346: Fontify sole lambda params, ELPA Syncer, 2021/08/29