Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more fully override imenu configuration when using outshine's imenu #93

Merged
merged 1 commit into from
Mar 26, 2022

Conversation

dankessler
Copy link

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 (so that imenu will pick up on outshine headings rather than whatever tags would normally be used). However, I think it misses one key variable: it's important to also overwrite imenu-create-index function, since if that is changed it essentially nerfs any of the other configuration (see the end part of the documentation.

I noticed this bug when editing R files in spacemacs: my 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.

I don't currently use navi mode, but I made an analogous fix in outshine-imenu-with-navi-regexp which I assume would suffer from the same issue.

I'm happy to also open an issue if it's preferred to have discussion over there, but figured I'd start with the PR since I already had a fix.

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.
@alphapapa
Copy link
Owner

I don't use Outshine regularly enough anymore to be familiar with its internals, but this seems simple enough, so I'll go ahead and merge it. Thanks very much.

@alphapapa alphapapa merged commit f4af4a1 into alphapapa:master Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants