Skip to content

Instantly share code, notes, and snippets.

@juxtin
Created March 4, 2016 23:01
Show Gist options
  • Save juxtin/0d558ff47acd86b1a5d5 to your computer and use it in GitHub Desktop.
Save juxtin/0d558ff47acd86b1a5d5 to your computer and use it in GitHub Desktop.
(defun abclj--other-ns (ns)
"If `ns' ends in `-test', strip that off. Otherwise, add `-test'."
(if (string-match-p "-test$" ns)
(string-remove-suffix "-test" ns)
(concat ns "-test")))
(defun abclj-jump-to-test-ns-or-back (&optional arg)
"If the point is in `project.namespace', jump to `project.namespace-test'. If
the point is in `project.namespace-test', jump to `project.namespace'."
(interactive "P")
(let ((target-ns (abclj--other-ns (cider-current-ns))))
(cider-find-ns arg target-ns)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment