Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mpenet/clojure-snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenet committed Oct 10, 2016
2 parents fb25053 + cabdbf9 commit 83785fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion clojure-snippets.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Max Penet <m@qbits.cc>
;; Keywords: snippets
;; Version: 1.0.0
;; Package-Requires: ((yasnippet "0.8.0"))
;; Package-Requires: ((yasnippet "0.8.0") (cl-lib "0.5"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down
36 changes: 18 additions & 18 deletions snippets/clojure-mode/ns
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# name: ns
# key: ns
# --
(ns `(flet ((try-src-prefix
(path src-pfx)
(let ((parts (split-string path src-pfx)))
(if (= 2 (length parts))
(second parts)
nil))))
(let* ((p (buffer-file-name))
(p2 (first
(remove-if-not '(lambda (x) x)
(mapcar
'(lambda (pfx)
(try-src-prefix p pfx))
'("/src/cljs/" "/src/clj/" "/src/")))))
(p3 (file-name-sans-extension p2))
(p4 (mapconcat '(lambda (x) x)
(split-string p3 "/")
".")))
(replace-regexp-in-string "_" "-" p4)))`)
(ns `(cl-flet ((try-src-prefix
(path src-pfx)
(let ((parts (split-string path src-pfx)))
(if (= 2 (length parts))
(cl-second parts)
nil))))
(let* ((p (buffer-file-name))
(p2 (cl-first
(cl-remove-if-not '(lambda (x) x)
(mapcar
'(lambda (pfx)
(try-src-prefix p pfx))
'("/src/cljs/" "/src/clj/" "/src/" "/test/")))))
(p3 (file-name-sans-extension p2))
(p4 (mapconcat '(lambda (x) x)
(split-string p3 "/")
".")))
(replace-regexp-in-string "_" "-" p4)))`)

0 comments on commit 83785fa

Please sign in to comment.