让 vc-diff 在 Emacs 23.2 中使用 ediff

发布于 2024-09-18 18:58:44 字数 311 浏览 7 评论 0原文

这在 Emacs 23.1.x 中运行良好,但在迁移到 Emacs 23.2 时似乎已损坏。

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

通常我按Cx v =并且ediff运行,因为我的.emacs中有以下配置

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

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

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

Had this working well in Emacs 23.1.x but it appears to have broke in the move to Emacs 23.2

I want to use ediff when comparing working copy of a file with SVN HEAD.

Normally I press C-x v = and ediff runs because of the following configuration in my .emacs

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

But, alas I still get the normal vc-diff buffer appearing and no ediff session...

Has anyone else encountered this and know what might be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

秋风の叶未落 2024-09-25 18:58:44

我有点怀疑上面的设置是否达到了你所说的效果。

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

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

Am a bit skeptical that the above setting did what you say it did.

That said, this will bind '=' to use 'ediff-revision:

(eval-after-load "vc-hooks"
         '(define-key vc-prefix-map "=" 'ediff-revision))
So尛奶瓶 2024-09-25 18:58:44

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

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

然后Cx v = 将启动 Ediff 会话。

I use the command vc-ediff to skip entering the file names: just compare the current modified copy with the base version (HEAD).

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

Then C-x v = will bring up the Ediff session.

染墨丶若流云 2024-09-25 18:58:44

发现我可以将 Cx 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

Found out I could just rebind C-x v = to the following:

(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))) 

This approach means you avoid having to specify the versions to compare as it defaults to comparing HEAD and the current file state.

Source: http://www.groupsrv.com/computers/about152826.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文