File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2684,6 +2684,19 @@ lists up."
2684
2684
(insert sexp)
2685
2685
(clojure--replace-sexps-with-bindings-and-indent)))
2686
2686
2687
+ (defun clojure--collect-ns-aliases ()
2688
+ " Collect all aliases in current ns form."
2689
+ (save-excursion
2690
+ (clojure--find-ns-in-direction 'backward )
2691
+ (let ((end (cdr (bounds-of-thing-at-point 'list )))
2692
+ (rgx (rx " :as" (+ space)
2693
+ (group-n 1 (+ (not (in " ,]\n " ))))))
2694
+ (res ()))
2695
+ (while (re-search-forward rgx end 'noerror )
2696
+ (message (match-string 1 ))
2697
+ (push (cons (point ) (match-string 1 )) res))
2698
+ res)))
2699
+
2687
2700
(defun clojure--rename-ns-alias-internal (current-alias new-alias )
2688
2701
" Rename a namespace alias CURRENT-ALIAS to NEW-ALIAS."
2689
2702
(clojure--find-ns-in-direction 'backward )
@@ -2747,7 +2760,8 @@ With a numeric prefix argument the let is introduced N lists up."
2747
2760
(defun clojure-rename-ns-alias ()
2748
2761
" Rename a namespace alias."
2749
2762
(interactive )
2750
- (let ((current-alias (read-from-minibuffer " Current alias: " )))
2763
+ (let ((current-alias (completing-read " Current alias: "
2764
+ (mapcar 'cdr (clojure--collect-ns-aliases)))))
2751
2765
(save-excursion
2752
2766
(clojure--find-ns-in-direction 'backward )
2753
2767
(let ((rgx (concat " :as +" current-alias))
You can’t perform that action at this time.
0 commit comments