diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ce38bf..f4e032f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * [#581](https://github.com/clojure-emacs/clojure-mode/issues/581): Fix font locking not working for keywords starting with a number. * [#377](https://github.com/clojure-emacs/clojure-mode/issues/377): Fix everything starting with the prefix 'def' being highlighted as a definition form. Now definition forms are enumerated explicitly in the font-locking code, like all other forms. +* [#638](https://github.com/clojure-emacs/clojure-mode/pull/638): Fix imenu with Clojure code in string or comment. ## 5.15.1 (2022-07-30) diff --git a/clojure-mode.el b/clojure-mode.el index 27a02f80..fc3813e5 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -777,7 +777,9 @@ Called by `imenu--generic-function'." (let (found? (deftype (match-string 2)) (start (point))) - (down-list) + ;; ignore user-error from down-list when called from inside a string or comment + (ignore-errors + (down-list)) (forward-sexp) (while (not found?) (ignore-errors