Skip to content

Instantly share code, notes, and snippets.

@sgrove
Created July 27, 2015 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgrove/68f336f3c29c413d7cbe to your computer and use it in GitHub Desktop.
Save sgrove/68f336f3c29c413d7cbe to your computer and use it in GitHub Desktop.
align-cljlet support for case and alt!
diff --git a/elpa/align-cljlet-0.3/align-cljlet.el b/elpa/align-cljlet-0.3/align-cljlet.el
index 072d19a..e105dc1 100644
--- a/elpa/align-cljlet-0.3/align-cljlet.el
+++ b/elpa/align-cljlet-0.3/align-cljlet.el
@@ -98,6 +98,8 @@
(string-match " *cond" name)
(string-match " *condp" name)
(string-match " *defroutes" name)
+ (string-match " *case" name)
+ (string-match " *alt" name)
)))
(if (looking-at "{")
t))))
@@ -280,10 +282,20 @@ positioned on the defroute form."
(down-list 1)
(forward-sexp 4)
(backward-sexp))
+ (if (looking-at "( *case\\b")
+ (progn
+ (down-list 1)
+ (forward-sexp 3)
+ (backward-sexp))
+ (if (looking-at "( *alt!")
+ (progn
+ (down-list 1)
+ (forward-sexp 2)
+ (backward-sexp))
(if (not (looking-at "{"))
;; move to start of [
(down-list 2)
- (down-list 1)))))
+ (down-list 1)))))))
(defun acl-align-form ()
"Determine what type of form we are currently positioned at and align it"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment