File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1888,6 +1888,11 @@ content) are considered part of the preceding sexp."
1888
1888
(zero-or-one (any " :'" )) ; ; (in-ns 'foo) or (ns+ :user)
1889
1889
(group (one-or-more (not (any " ()\" " whitespace))) symbol-end)))
1890
1890
1891
+ (make-obsolete-variable 'clojure-namespace-name-regex 'clojure-namespace-regexp " 5.12.0" )
1892
+
1893
+ (defconst clojure-namespace-regexp
1894
+ (rx line-start " (" (? " clojure.core/" ) (or " in-ns" " ns" " ns+" )))
1895
+
1891
1896
(defcustom clojure-cache-ns nil
1892
1897
" Whether to cache the results of `clojure-find-ns' .
1893
1898
@@ -1911,9 +1916,16 @@ DIRECTION is `forward' or `backward'."
1911
1916
#'search-forward-regexp
1912
1917
#'search-backward-regexp )))
1913
1918
(while (and (not candidate)
1914
- (funcall fn clojure-namespace-name-regex nil t ))
1915
- (unless (or (clojure--in-string-p) (clojure--in-comment-p))
1916
- (setq candidate (match-string-no-properties 4 ))))
1919
+ (funcall fn clojure-namespace-regexp nil t ))
1920
+ (let ((end (match-end 0 )))
1921
+ (save-excursion
1922
+ (save-match-data
1923
+ (goto-char end)
1924
+ (clojure-forward-logical-sexp)
1925
+ (when (and (looking-back clojure--sym-regexp end 'greedy )
1926
+ (not (clojure--in-string-p))
1927
+ (not (clojure--in-comment-p)))
1928
+ (setq candidate (match-string-no-properties 0 )))))))
1917
1929
candidate))
1918
1930
1919
1931
(defun clojure-find-ns ()
You can’t perform that action at this time.
0 commit comments