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

"No items suitable for an index found in this buffer" #51

Closed
romatthe opened this issue Jul 13, 2019 · 3 comments
Closed

"No items suitable for an index found in this buffer" #51

romatthe opened this issue Jul 13, 2019 · 3 comments

Comments

@romatthe
Copy link

Hi,

I'm trying to use your package, but I'm getting an error each time I try to open the side view:

imenu-unavailable-error: imenu unavailable: "No items suitable for an index found in this buffer"

I'm doing this in an Emacs-Lisp buffer, with elisp-mode being the major mode. I've just set up rhe package in the most simple way possible.

(use-package imenu-list
  :bind ("C-." . imenu-list-smart-toggle)
  :custom
  (imenu-list-focus-after-activation t)
  (imenu-list-auto-resize t))

I've checked if any packages interfered somehow with the index creation function, but it's simply set to imenu-default-create-index-function.

Any other things I can check to debug this?

Thanks!

Oh, and I'm using Emacs 26.2.

@bmag
Copy link
Owner

bmag commented Jul 14, 2019

I am assuming you open an Elisp buffer, then activate imenu-list via imenu-list-smart-toggle. This error tells you the index is empty, so imenu-list has nothing to display. For example, an Elisp buffer with only use-package declarations (without defvars or defuns) has no index entries (without further customization to imenu). So if it is a similar case, then imenu-list is working as expected.

Otherwise, steps to debug include:

  • invoke M-x imenu from the Elisp buffer to see if that works and to explore the index.
  • get a backtrace by M-x toggle-debug-on-error followed by M-x imenu-list-update from the Elisp buffer to see where the error originates from (although we already know it's because the index is empty).
  • check the relevant imenu variables for suspicious values: imenu-default-create-index-function, imenu-generic-expression and sometimes others. The exact variables that are relevant depend on the index function (the value of imenu-default-create-index-function), and I don't remember all of them off right now. These are all buffer-local values, so be sure you are looking at their values in the correct buffer.

If you could post the contents of the buffer then I could look at it on my side, but I'm pretty sure it's just that the index is empty.

@romatthe
Copy link
Author

Thanks, I'll try this as soon as possible.

@romatthe
Copy link
Author

romatthe commented Nov 8, 2019

I realized this issue was still open, sorry about that. I had to stop using Emacs for a while due to working on a bunch of different stuff and forgot about this.

Regardless, I think this was indeed a matter of imenu-list working just fine, but I interpreted the message as being an error rather than expected behaviour.

Again, sorry about leaving this open for such a long time.

@romatthe romatthe closed this as completed Nov 8, 2019
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

No branches or pull requests

2 participants