Skip to content

Commit 5d2f48b

Browse files
committed
[Fix #281] Add support for namespace-prefixed definition forms
1 parent 0bf874e commit 5d2f48b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Changes
66

77
* Add `.cljc` to `auto-mode-alist`.
8+
* [#281](https://github.com/clojure-emacs/clojure-mode/pull/281): Add support for namespace-prefixed definition forms.
89

910
### Bugs fixed
1011

clojure-mode.el

+3-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
329329
(defun clojure-match-next-def ()
330330
"Scans the buffer backwards for the next \"top-level\" definition.
331331
Called by `imenu--generic-function'."
332-
(when (re-search-backward "^(def\\sw*" nil t)
332+
;; we have to take into account namespace-definition forms
333+
;; e.g. s/defn
334+
(when (re-search-backward "^(\\([a-z0-9.-]+/\\)?def\\sw*" nil t)
333335
(save-excursion
334336
(let (found?
335337
(start (point)))

0 commit comments

Comments
 (0)