Midje Emacs workflow now

56 views
Skip to first unread message

David Kincaid

unread,
Jan 18, 2015, 4:54:24 PM1/18/15
to mi...@googlegroups.com
With midje-mode no longer working with Cider's latest versions I'm wondering what people's workflow is when writing Midje tests in Emacs. I used to do a lot of C-c . to run a single test but that no longer works. Can anyone offer an easy fix for how to run individual tests from within the buffer?

Thanks,

Dave

ChrisCruft

unread,
Jan 19, 2015, 6:33:29 PM1/19/15
to mi...@googlegroups.com
I'm in the same boat.  I'm stuck with evaluating the whole buffer (C-c, C-l) 

Brian Marick

unread,
Jan 19, 2015, 6:44:02 PM1/19/15
to mi...@googlegroups.com
I switched to using autotest in the repl a couple of years ago. In
particular, this is how I use Clojure in emacs these days:

http://about.getset.com/developer-blog/2014/12/1/my-clojure-micro-workflow

David Kincaid

unread,
Jan 19, 2015, 7:16:37 PM1/19/15
to mi...@googlegroups.com
That's really nice, Brian. I'd still love to be able to run a single test at a time, but I've started using autotest too and getting used to it.

Could you share how to switch between windows with a single keystroke in your setup? My setup is similar a lot of the time, but I'm always doing C-x o, C-x o ... to get to the buffer I want.

- Dave

Brian Marick

unread,
Jan 19, 2015, 8:48:15 PM1/19/15
to mi...@googlegroups.com
David Kincaid wrote:
> Could you share how to switch between windows with a single keystroke in
> your setup? My setup is similar a lot of the time, but I'm always doing
> C-x o, C-x o ... to get to the buffer I want.

Since the windows are always the same size, I can do the following:

(defun h-window () (window-at 1 1))
(defun j-window () (window-at 150 1))
(defun k-window () (window-at 1 50))
(defun l-window () (window-at 150 50))

And so each can have a switch function:

(defun switch-to-foo-window (window)
(select-window (funcall window)))
(defun switch-to-h-window () (interactive) (switch-to-foo-window 'h-window))
(defun switch-to-j-window () (interactive) (switch-to-foo-window 'j-window))
(defun switch-to-k-window () (interactive) (switch-to-foo-window 'k-window))
(defun switch-to-l-window () (interactive) (switch-to-foo-window 'l-window))

(global-set-key (kbd "s-h") 'switch-to-h-window)
(global-set-key (kbd "s-j") 'switch-to-j-window)
(global-set-key (kbd "s-k") 'switch-to-k-window)
(global-set-key (kbd "s-l") 'switch-to-l-window)


You can find all of this code in
https://github.com/marick/.emacs.d/blob/master/init.el Warning: a lot of
my elisp is pretty crude. I haven't kept up with all of the new stuff
("new" meaning since around 1990).

Warning: the `^x o` habit is really hard to break.
Reply all
Reply to author
Forward
0 new messages