File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -491,15 +491,24 @@ datatypes) in a Haskell file for the `imenu' package."
491
491
(name (car name-posns))
492
492
(posns (cdr name-posns))
493
493
(start-pos (car posns))
494
- (type (cdr result))
494
+ (type (cdr result)))
495
495
; ; Place `(name . start-pos)' in the correct alist.
496
- (sym (cdr (assq type
497
- '((variable . index-var-alist)
498
- (datatype . index-type-alist)
499
- (class . index-class-alist)
500
- (import . index-imp-alist)
501
- (instance . index-inst-alist))))))
502
- (set sym (cons (cons name start-pos) (symbol-value sym))))))
496
+ (cl-case type
497
+ (variable
498
+ (setq index-var-alist
499
+ (cl-acons name start-pos index-var-alist)))
500
+ (datatype
501
+ (setq index-type-alist
502
+ (cl-acons name start-pos index-type-alist)))
503
+ (class
504
+ (setq index-class-alist
505
+ (cl-acons name start-pos index-class-alist)))
506
+ (import
507
+ (setq index-imp-alist
508
+ (cl-acons name start-pos index-imp-alist)))
509
+ (instance
510
+ (setq index-inst-alist
511
+ (cl-acons name start-pos index-inst-alist)))))))
503
512
; ; Now sort all the lists, label them, and place them in one list.
504
513
(message " Sorting declarations in %s ... " bufname)
505
514
(when index-type-alist
You can’t perform that action at this time.
0 commit comments