branch: elpa/git-commit
commit 8fef6b96516e0375fb0d45d6f48053fda8501e00
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-status-mode: Add more to Imenu index
    
    Explicitly exclude the headers, including everything else.  Previously
    we tried to explicitly include everything else, but that doesn't work
    so well when extensions add their own sections, which in all
    likelihood should also be indexed.
---
 lisp/magit-mode.el   | 6 +++++-
 lisp/magit-status.el | 3 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 3a8df694c4..70187d21ba 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1473,7 +1473,11 @@ mentioned caches completely."
                (lambda (section)
                  (cond
                   (magit--imenu-group-types
-                   (and (magit-section-match magit--imenu-group-types section)
+                   (and (if (eq (car-safe magit--imenu-group-types) 'not)
+                            (not (magit-section-match
+                                  (cdr magit--imenu-group-types)
+                                  section))
+                          (magit-section-match magit--imenu-group-types 
section))
                         (when-let ((children (oref section children)))
                           `((,(magit--imenu-index-name section)
                              ,@(mapcar (lambda (s)
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index cd97e035b5..2bd428d8e5 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -406,8 +406,7 @@ Type \\[magit-commit] to create a commit.
 \\{magit-status-mode-map}"
   :group 'magit-status
   (hack-dir-local-variables-non-file-buffer)
-  (setq magit--imenu-group-types
-        '(unpushed unstaged unpulled untracked staged stashes pullreqs 
issues)))
+  (setq magit--imenu-group-types '(not branch commit)))
 
 (put 'magit-status-mode 'magit-diff-default-arguments
      '("--no-ext-diff"))

Reply via email to