From f4af4a1e368a6256d4f3f6fdc41e7c4314775c36 Mon Sep 17 00:00:00 2001 From: Dan Kessler Date: Sat, 12 Mar 2022 18:30:16 -0500 Subject: [PATCH] more fully override imenu configuration when using outshine's imenu When using outshine's imenu functionality (from either `outshine-imenu` or `outshine-imenu-with-navi-regexp`), the variables that configure imenu behavior are locally overwritten in a `let*` form. However, it's important to also restore the default setting of `imenu-create-index-function` (which should be `imenu-default-create-index-function`). I noticed this bug when editing `R` files in `spacemacs`: the `lsp` configuration involves changing the value of `imenu-create-index-function`, which makes changes to the other variables inconsequential, and then outshine's attempt to change the way imenu works by binding `imenu-generic-expression` has no effect. --- outshine.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/outshine.el b/outshine.el index 93a6a01..6e57e15 100644 --- a/outshine.el +++ b/outshine.el @@ -2143,6 +2143,7 @@ i.e. the text following the regexp match until the next space character." outshine-imenu-generic-expression) (imenu-prev-index-position-function nil) (imenu-extract-index-name-function nil) + (imenu-create-index-function 'imenu-default-create-index-function) (imenu-auto-rescan t) (imenu-auto-rescan-maxout 360000)) ;; prefer idomenu @@ -2173,6 +2174,7 @@ i.e. the text following the regexp match until the next space character." outshine-imenu-default-generic-expression) (imenu-prev-index-position-function nil) (imenu-extract-index-name-function nil) + (imenu-create-index-function 'imenu-default-create-index-function) (imenu-auto-rescan t) (imenu-auto-rescan-maxout 360000)) ;; prefer idomenu