From f4af4a1e368a6256d4f3f6fdc41e7c4314775c36 Mon Sep 17 00:00:00 2001 From: Dan Kessler Date: Sat, 12 Mar 2022 18:30:16 -0500 Subject: [PATCH 1/2] 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 From 068831f3ff4fd1fc55fcbdf32372de9559a57238 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 26 Mar 2022 00:39:50 -0500 Subject: [PATCH 2/2] Docs: Update changelog --- README.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.org b/README.org index 2ea69a4..5877f77 100644 --- a/README.org +++ b/README.org @@ -87,6 +87,9 @@ If you experience issues with Emacs not recognizing these bindings when running + Add ~outshine-define-key~ macro for defining conditional key bindings (e.g. on headlines). Improves on previous ~outshine-define-key-with-fallback~ macro by interning a named function and matching the function signature of ~define-key~. + Bind @@html:@@ @@html:@@ to ~outshine-cycle-buffer~ on headlines +*Fixed* ++ More fully override Imenu configuration when using ~outshine-imenu~. ([[https://github.com/alphapapa/outshine/pull/93][#93]]. Thanks to [[https://github.com/dankessler][Dan Kessler]].) + *Deprecated* + Declare ~outshine-define-key-with-fallback~ as obsolete, use ~outshine-define-key~ instead