Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
632 B

# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: ns
# key: ns
# --
(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)))`)