Skip to content

Commit a8ffd75

Browse files
committed
Remove cons cell
1 parent 7758145 commit a8ffd75

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clojure-mode.el

+2-4
Original file line numberDiff line numberDiff line change
@@ -2692,8 +2692,7 @@ lists up."
26922692
(group-n 1 (+ (not (in " ,]\n"))))))
26932693
(res ()))
26942694
(while (re-search-forward rgx end 'noerror)
2695-
(message (match-string 1))
2696-
(push (cons (point) (match-string-no-properties 1)) res))
2695+
(push (match-string-no-properties 1) res))
26972696
res)))
26982697

26992698
(defun clojure--rename-ns-alias-internal (current-alias new-alias)
@@ -2759,8 +2758,7 @@ With a numeric prefix argument the let is introduced N lists up."
27592758
(defun clojure-rename-ns-alias ()
27602759
"Rename a namespace alias."
27612760
(interactive)
2762-
(let ((current-alias (completing-read "Current alias: "
2763-
(mapcar 'cdr (clojure--collect-ns-aliases)))))
2761+
(let ((current-alias (completing-read "Current alias: " (clojure--collect-ns-aliases))))
27642762
(save-excursion
27652763
(clojure--find-ns-in-direction 'backward)
27662764
(let ((rgx (concat ":as +" current-alias))

test/clojure-mode-refactor-rename-ns-alias-test.el

+5-2
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@
114114
(with-clojure-buffer
115115
"(ns test.ns
116116
(:require [my.math.subtraction :as math.-]
117-
[my.math.multiplication :as math.*]))
117+
[my.math.multiplication :as math.*]
118+
[clojure.spec.alpha as s]
119+
;; [clojure.spec.alpha2 :as s2]
120+
[symbols :as abc123.-$#.%*+!@]))
118121
119122
(math.*/operator 1 (math.-/subtract 2 3))"
120123
(expect (clojure--collect-ns-aliases)
121-
:to-equal '((104 . "math.*") (56 . "math.-"))))))
124+
:to-equal '("abc123.-$#.%*+!@" "s" "math.*" "math.-")))))
122125

123126
(provide 'clojure-mode-refactor-rename-ns-alias-test)
124127

0 commit comments

Comments
 (0)