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

Handle special elements of imenu--index-alist that provides function to call #58

Closed
muffinmad opened this issue Jun 26, 2020 · 1 comment

Comments

@muffinmad
Copy link

From imenu--index-alist docstring:

Special elements look like
(INDEX-NAME POSITION FUNCTION ARGUMENTS...).
To "go to" a special element means applying FUNCTION to
INDEX-NAME, POSITION, and the ARGUMENTS.

Eglot creates this kind of imenu--index-alist:

(("Function"
  (#1="foo"
      [(:containerName nil :kind 12 :name #1# :location
		       (:range
			(:start
			 (:line 0 :character 0)
			 :end
			 (:line 2 :character 0))
			:uri "file:///Users/mad/workspace/test/test.py"))]
      #f(compiled-function
	 (name one-obj-array)
	 #<bytecode -0x17f965a3c21ddd45>))))

Calling imenu-list-smart-toggle lead to this error:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p [(:containerName nil :kind 12 :name "foo" :location (:range (:start (:line 0 :character 0) :end (:line 2 :character 0)) :uri "file:///Users/mad/workspace/test/test.py"))])
  imenu-list-<=(#<marker at 1 in test.py> [(:containerName nil :kind 12 :name "foo" :location (:range (:start (:line 0 :character 0) :end (:line 2 :character 0)) :uri "file:///Users/mad/workspace/test/test.py"))] #<marker at 1 in test.py>)
  imenu-list--current-entry()
  imenu-list--show-current-entry()
  imenu-list-update(nil t)
  imenu-list-minor-mode(1)
  imenu-list-smart-toggle()
  funcall-interactively(imenu-list-smart-toggle)
  call-interactively(imenu-list-smart-toggle record nil)
  command-execute(imenu-list-smart-toggle record)
  execute-extended-command(nil "imenu-list-smart-toggle" nil)
  funcall-interactively(execute-extended-command nil "imenu-list-smart-toggle" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
@bmag
Copy link
Owner

bmag commented Mar 2, 2021

Continued in #63.

@bmag bmag closed this as completed Mar 2, 2021
joaotavora added a commit to joaotavora/eglot that referenced this issue Sep 8, 2022
Fix #758, #536, #535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example #758, #536, #535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
Fix joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Fix joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Fix #758, #536, #535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example #758, #536, #535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change

#758: joaotavora/eglot#758
#536: joaotavora/eglot#536
#535: joaotavora/eglot#535
#758: joaotavora/eglot#758
#536: joaotavora/eglot#536
#535: joaotavora/eglot#535
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Fix joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 20, 2022
Fix joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.

Eglot's eglot-imenu returned a structure compliant with the rules
outlined in imenu--index-alist.  In particular, it returned some
elements of the form

  (INDEX-NAME POSITION GOTO-FN ARGUMENTS...)

The original intention (mine) must have been to allow fancy
highlighting of the position navigated to with a custom GOTO-FN.

Not only was access to that fanciness never implemented, but many
other imenu frontends do not support such elements.

See for example joaotavora/eglot#758, joaotavora/eglot#536, joaotavora/eglot#535.  And also related issues in other
packages:

colonelpanic8/flimenu#6
bmag/imenu-list#58

So it's best to remove this problematic feature for now.  It can be
added back later.

* eglot.el (eglot-imenu): Simplify.

* NEWS.md: Mention change
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