Commit fe29a03
Fix imenu with Clojure code in string or comment
Ignore error that's thrown from `down-list` when called
with point inside a string or comment.
E.g. with code like:
```
(defn foo []
(let [a "
(defn b [_]
(bar {:bla \"bla\"}))"]))
```
`clojure-match-next-def` calls `down-list` with point inside
the string and `down-list` will throw an user-error with
"This command doesn't work in strings or comments".
This user-error in `down-list` got introduced 2022-05-06
with https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0b3b295776ce723885c9997ab26d57314db2a5df
The `when ignore-errors` could be replaced with
`unless (ppss-comment-or-string-start (syntax-ppss))`
once the minimum requirement for clojure-mode is Emacs 27.1 parent 3717e44 commit fe29a03
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
781 | 783 | | |
782 | 784 | | |
783 | 785 | | |
| |||
0 commit comments