File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1104,13 +1104,15 @@ Useful if a file has been renamed."
11041104
11051105(defun clojure-find-ns ()
11061106 " Find the namespace of the current Clojure buffer."
1107- (let ((regexp clojure-namespace-name-regex))
1108- (save-excursion
1109- (save-restriction
1110- (widen )
1111- (goto-char (point-min ))
1112- (when (re-search-forward regexp nil t )
1113- (match-string-no-properties 4 ))))))
1107+ (save-excursion
1108+ (save-restriction
1109+ (widen )
1110+ ; ; The closest ns form above point.
1111+ (when (or (re-search-backward clojure-namespace-name-regex nil t )
1112+ ; ; Or any form at all.
1113+ (and (goto-char (point-min ))
1114+ (re-search-forward clojure-namespace-name-regex nil t )))
1115+ (match-string-no-properties 4 )))))
11141116
11151117(defun clojure-find-def ()
11161118 " Find the var declaration macro and symbol name of the current form.
You can’t perform that action at this time.
0 commit comments