File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
### New features
11
11
12
+ * Add imenu support for multimethods
12
13
* New interactive command ` clojure-cycle-when ` .
13
14
* New interactive command ` clojure-cycle-not ` .
14
15
Original file line number Diff line number Diff line change @@ -657,23 +657,28 @@ and `(match-end 1)'."
657
657
Called by `imenu--generic-function' ."
658
658
; ; we have to take into account namespace-definition forms
659
659
; ; e.g. s/defn
660
- (when (re-search-backward " ^(\\ ([a-z0-9.-]+/\\ )?def\\ sw*" nil t )
660
+ (when (re-search-backward " ^(\\ ([a-z0-9.-]+/\\ )?\\ ( def\\ sw*\\ ) " nil t )
661
661
(save-excursion
662
662
(let (found?
663
+ (deftype (match-string 2 ))
663
664
(start (point )))
664
665
(down-list )
665
666
(forward-sexp )
666
667
(while (not found?)
667
668
(ignore-errors
668
669
(forward-sexp ))
669
- (or (if (char-equal ?[ (char-after (point )))
670
- (backward-sexp ))
671
- ( if (char-equal ?) (char-after (point )))
670
+ (or (when (char-equal ?[ (char-after (point )))
671
+ (backward-sexp ))
672
+ ( when (char-equal ?) (char-after (point )))
672
673
(backward-sexp )))
673
674
(cl-destructuring-bind (def-beg . def-end) (bounds-of-thing-at-point 'sexp )
674
675
(if (char-equal ?^ (char-after def-beg))
675
676
(progn (forward-sexp ) (backward-sexp ))
676
677
(setq found? t )
678
+ (when (string= deftype " defmethod" )
679
+ (setq def-end (progn (goto-char def-end)
680
+ (forward-sexp )
681
+ (point ))))
677
682
(set-match-data (list def-beg def-end)))))
678
683
(goto-char start)))))
679
684
You can’t perform that action at this time.
0 commit comments