6

我正在使用带有 cvs 的 emacs 并启用了 cvs 模式。我想逐行突出显示 CVS 中最新版本的更改。我已经在 intellij 中看到了这一点,其中有一个绿色指示表示添加的行,另一个指示表示已修改的行,第三个符号表示已删除的行。

emacs 是否有 cvs 高亮模式来显示最新版本 cvs 的更改?我不是在寻找可以cvs diff在新缓冲区中打开的类型功能,而是在我当前的缓冲区中指示哪些行已被修改的东西。

在下图中,左侧有一个蓝色矩形,Intellij 称之为“装订线”,表示代码与源代码管理中的不同。

智能示例
(来源:jetbrains.com

我在 emacs 中寻找类似的功能。

4

4 回答 4

4

您现在可以查看diff-hl,它在左侧窗口边缘提供突出显示。

到目前为止,我只在一些现代 DVCS 上对其进行了测试,但如果您仍在使用 CVS,并且它不能正常工作,请提出问题。

于 2012-06-26T11:45:57.593 回答
2

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)
于 2009-02-26T00:21:43.543 回答
1

你想要,默认情况下vc-diff是打开的。C-x v =这为您提供临时缓冲区中的原始差异输出。缓冲区使用差异模式,它有一些巧妙的技巧......例如,您可以使用C-c C-e将差异作为补丁应用到另一个文件。在 diff 缓冲区中使用describe-mode(C-h m默认情况下) 来查找其他技巧。

于 2009-02-26T02:38:29.160 回答
0

也许您喜欢Ediff,它似乎完全符合您的要求。

于 2009-02-25T23:06:28.887 回答