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

Fix haskell-ds-create-imenu-index to work properly in lexical binding mode #839

Merged
merged 1 commit into from
Aug 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions haskell-decl-scan.el
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,24 @@ datatypes) in a Haskell file for the `imenu' package."
(name (car name-posns))
(posns (cdr name-posns))
(start-pos (car posns))
(type (cdr result))
(type (cdr result)))
;; Place `(name . start-pos)' in the correct alist.
(sym (cdr (assq type
'((variable . index-var-alist)
(datatype . index-type-alist)
(class . index-class-alist)
(import . index-imp-alist)
(instance . index-inst-alist))))))
(set sym (cons (cons name start-pos) (symbol-value sym))))))
(cl-case type
(variable
(setq index-var-alist
(cl-acons name start-pos index-var-alist)))
(datatype
(setq index-type-alist
(cl-acons name start-pos index-type-alist)))
(class
(setq index-class-alist
(cl-acons name start-pos index-class-alist)))
(import
(setq index-imp-alist
(cl-acons name start-pos index-imp-alist)))
(instance
(setq index-inst-alist
(cl-acons name start-pos index-inst-alist)))))))
;; Now sort all the lists, label them, and place them in one list.
(message "Sorting declarations in %s..." bufname)
(when index-type-alist
Expand Down