让vc-diff在Emacs 23.2中使用ediff

时间:2010-09-14 20:54:52

标签: version-control emacs diff

如果这在Emacs 23.1.x中运行良好,但它似乎在转向Emacs 23.2时已经破产

我想在将文件的工作副本与SVN HEAD进行比较时使用ediff。

通常我按 C-x v = 和ediff运行,因为我的.emacs中有以下配置

;; Use ediff and not diff 
(setq diff-command "ediff")

但是,唉,我仍然会出现正常的vc-diff缓冲区而没有ediff会话...

有没有其他人遇到过这个并知道可能是什么问题?

3 个答案:

答案 0 :(得分:8)

有点怀疑上述设置是否符合您的说法。

也就是说,这将绑定'='以使用'ediff-revision

(eval-after-load "vc-hooks"
         '(define-key vc-prefix-map "=" 'ediff-revision))

答案 1 :(得分:4)

发现我可以将 C-x v = 重新绑定到以下内容:

(defun ediff-current-buffer-revision () 
  "Run Ediff to diff current buffer's file against VC depot. 
Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." 
  (interactive) 
  (let ((file (or (buffer-file-name) 
          (error "Current buffer is not visiting a file")))) 
(if (and (buffer-modified-p) 
     (y-or-n-p (message "Buffer %s is modified. Save buffer? " 
                (buffer-name)))) 
    (save-buffer (current-buffer))) 
(ediff-load-version-control) 
(funcall 
 (intern (format "ediff-%S-internal" ediff-version-control-package)) 
 "" "" nil))) 

这种方法意味着您无需指定要比较的版本,因为它默认为比较HEAD和当前文件状态。

来源:http://www.groupsrv.com/computers/about152826.html

答案 2 :(得分:4)

我使用命令vc-ediff来跳过输入文件名:只需将当前修改后的副本与基本版本(HEAD)进行比较。

(eval-after-load "vc-hooks"
         '(define-key vc-prefix-map "=" 'vc-ediff))

然后C-x v =将调出Ediff会话。