Better SVN workflow in Emacs
Friday 18 September 2009 - Filed under Uncategorized
I’ve found a way to get the 3-column window layout with vc-dir, vc-diff and vc-log I showed in my previous post about SVN workflow in Emacs by default, without the manual setup I was complaining about.
(Update: It looks like this customization only exists in Emacs 23.)
The key is that vc-mode uses a standard function, pop-to-buffer, to create the new window for vc-diff and vc-log. This is the function that keeps creating horizontal splits that make no sense on my widescreen display. However, it ends up calling a function called split-window-sensibly, which can be customized (of course!). So, if I set the “Split Height Threshold” to nil, split-window-sensibly will never split horizontally, and then the default behavior just magically does what I want. If I start with just a single vc-dir window and invoke vc-diff and vc-log, I get my three columns!
To get to the right customization screen, just do M-x customize-apropos <ret> ^Split.*Threshold. That’ll get you the two relevant customization items. Enjoy!
2009-09-18 » mike
20 September 2009 @ 7:22 am
I’m a bit confused. How do you actually go about running vc-diff and vc-log? When I run the second command it takes over the window instead of creating a new one. Is that the bit that vc-checkin-mike does? If so is there a way that I could see it? That’s the part that I wold be interested in. I don’t that it’s not polished etc.
20 September 2009 @ 7:55 am
Hi Ivan, here’s what I do:
start with one window (no splits). Usually a file in the directory I’m checking in.
run vc-dir (C-x v d) on the directory I need to check in from.
using the vc-dir mode, type ‘=’ to see the diff for a file (or set of marked files). This splits the window and opens a new vc-diff buffer.
go back to vc-dir mode, and type ‘v’ on that same file or set. Now I have three columns, vc-dir, vc-log, and vc-diff.
I write the log and use M-C-v to scroll down the diff window with the cursor in the log window.
This works best on really wide screens, and with the Split Width Threshold set to about 100 columns, so it’ll split vertically more than once before reusing windows.
20 September 2009 @ 4:45 pm
Thanks, split-width-threshold was the piece I was missing.