views:

405

answers:

3
A: 

Perhaps you'd like Ediff, which appears to do exactly what you want.

dwc
Not exactly what I am looking for. I want a minor mode so it can always be on when editing code. I also want to compare directly against CVS without getting a second local copy of the original version.
Alex B
How does IntelliJ handle this? It seems like what you're asking is awfully expensive...
dwc
A: 

Here's another answer that doesn't do what you want either, but may be useful.

C-x v g

runs the command vc-annotate.

That'll pop up a new buffer (I know, you didn't want one), but it'll have all the lines marked with who touched them when. And, bonus, they're color coded with a heatmap (red is most recent, blue is least), for easy identification of recent changes.

Of course the built-in version of vc-annotate doesn't scroll the buffer appropriately, so you'll want this advice:

(defadvice vc-annotate (around vc-annotate-and-scroll)
  "scroll buffer to view current line in the annotated buffer"
  (let ((pos (count-lines (point-min) (point))))
    ad-do-it
    (let ((orig-window (selected-window))
          (window (other-window-for-scrolling)))
      (select-window window)
      (goto-line pos)
      (select-window orig-window))))

(ad-activate 'vc-annotate)
Trey Jackson
+1  A: 

You want vc-diff, which is on C-x v = by default. This gives you raw diff output in a temp buffer. The buffer uses diff-mode, which has a few neat tricks ... for example, you can use C-c C-e to apply the diff as a patch to another file. Use describe-mode (C-h m by default) in the diff buffer to find the other tricks.

nullptr