Skip to content
Browse files

Add marking of clojure set literal.

  • Loading branch information...
1 parent 35ddbf7 commit f14ba9ab2765fa0848896c96f39b6985e154782a @magnars committed
Showing with 15 additions and 0 deletions.
  1. +15 −0 clojure-mode-expansions.el
View
15 clojure-mode-expansions.el
@@ -46,6 +46,20 @@
(while (looking-back word-regexp)
(backward-char)))))
+(defun er/mark-clj-set-literal ()
+ "Mark clj-set-literal presumes that point is outside the brackets.
+If point is inside the brackets, those will be marked first anyway."
+ (interactive)
+ (when (or (looking-at "#{")
+ (looking-back "#"))
+ (forward-char 1)
+ (search-backward "#")
+ (set-mark (point))
+ (search-forward "{")
+ (forward-char -1)
+ (forward-list 1)
+ (exchange-point-and-mark)))
+
(defun er/mark-clj-regexp-literal ()
"Mark clj-regexp-literal presumes that point is outside the string.
If point is inside the string, the quotes will be marked first anyway."
@@ -80,6 +94,7 @@ If point is inside the parens, they will be marked first anyway."
er/try-expand-list
'(er/mark-clj-word
er/mark-clj-regexp-literal
+ er/mark-clj-set-literal
er/mark-clj-function-literal))))
(er/enable-mode-expansions 'clojure-mode 'er/add-clojure-mode-expansions)

0 comments on commit f14ba9a

Please sign in to comment.
Something went wrong with that request. Please try again.