Skip to content

Commit 5cef56c

Browse files
committed
Merge pull request #2 from johnwalker/refactor
Replace kill-ring code with thing-at-point
2 parents cda1cea + 41eb5c7 commit 5cef56c

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

typed-clojure-mode.el

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,7 @@
160160
(defun typed-clojure-ann-var ()
161161
(interactive)
162162
(lexical-let ((t (read-string "Annotate var with type (default Any): ")))
163-
(ignore-errors
164-
(forward-sexp)
165-
(backward-sexp))
166-
(mark-sexp)
167-
(kill-ring-save (region-beginning) (region-end))
168-
; turn off mark
169-
(set-mark-command 0)
170-
(lexical-let ((sym (car kill-ring)))
163+
(lexical-let ((sym (thing-at-point 'symbol)))
171164
(lexical-let ((p (typed-clojure-qualify-ann-var sym)))
172165
(if p
173166
(progn
@@ -177,10 +170,8 @@
177170
(insert (format "(%sann " (typed-clojure-lowest-ns 'ann)))
178171
(insert (concat p " " (if (= 0 (length t)) "Any" t) ")"))
179172
())
180-
(error (concat "Current form is not a symbol: " sym)))
181-
))
182-
(backward-sexp))
183-
)
173+
(error (concat "Current form is not a symbol: " sym)))))
174+
(backward-sexp)))
184175

185176
(defun typed-clojure-ann-form ()
186177
(interactive)

0 commit comments

Comments
 (0)