如何在 Windows + NTEmacs 下使用 ediff?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7423921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I use ediff under Windows + NTEmacs?
提问by sam
I have Emacs version 23 on Windows and it seem the ediff
executable is missing?
我在 Windows 上安装了 Emacs 23 版,但似乎ediff
缺少可执行文件?
From where can I download ediff
for Emacs on Windows?
我可以从哪里下载ediff
Windows 上的 Emacs?
回答by Ender Wan
You can download diffUtils, extract it, add the path to %PATH% and emacs exec-path in your Emacs init file like that.
你可以下载diffUtils,解压它,在你的 Emacs init 文件中添加 %PATH% 和 emacs exec-path 的路径。
(when (string-equal system-type "windows-nt")
(progn
(setq diff-path "your-diff-path")
(setenv "PATH"
(concat diff-path ";"))
(setq exec-path
'(diff-path))))
finally, using M-x diff
to compare what you want.
最后,M-x diff
用来比较你想要的。
回答by FlyingFoX
If you have git for windows installed, then it is enough to add
如果你安装了 git for windows,那么添加就足够了
C:\Program Files\Git\usr\bin\
to your PATH environment variable, because git for windows already ships with a diff executable and installs it in that folder.
到您的 PATH 环境变量,因为 git for windows 已经附带了一个 diff 可执行文件并将其安装在该文件夹中。
回答by phils
It's probably a Windows-native diff that you're missing. You really want to have access to a suite of additional Unix-like tools when you run NTEmacs.
这可能是您缺少的 Windows 原生差异。当您运行 NTEmacs 时,您确实希望能够访问一套额外的类 Unix 工具。
Cygwin is probably the most common solution. Many people use the GNUWin32 tools instead ("much faster, though less complete, than the Cygwin ones").
Cygwin 可能是最常见的解决方案。许多人改用 GNUWin32 工具(“比 Cygwin 工具快得多,但不完整”)。
See here for more details: How to best integrate Emacs and Cygwin?
有关更多详细信息,请参见此处: 如何最好地集成 Emacs 和 Cygwin?
Emacs Wiki: http://www.emacswiki.org/emacs/CygWin
Emacs 维基:http: //www.emacswiki.org/emacs/CygWin
Be aware that as well as NTEmacs, there is a Cygwin-native Emacs as well. So you can either use NTEmacs with Cygwin providing all the additional tools; or you can ignore NTEmacs entirely, and install Cygwin's Emacs package and just use that. NTEmacs is faster, but Cygwin Emacs integrates better with the rest of Cygwin in a few areas.
请注意,除了 NTEmacs,还有一个 Cygwin 原生的 Emacs。因此,您可以将 NTEmacs 与 Cygwin 一起使用,提供所有附加工具;或者您可以完全忽略 NTEmacs,并安装 Cygwin 的 Emacs 包并使用它。NTEmacs 速度更快,但 Cygwin Emacs 在某些方面与 Cygwin 的其余部分集成得更好。
回答by user443854
When you run ediff
from emacs, it does indeed look for an executable diff
. One way to get it is to install cygwin. You don't have to use Emacs from cygwin to use diff
. Just add c:\cygwin\bin
(use your cygwin install path) to %PATH%
and restart emacs.
当您ediff
从 emacs运行时,它确实会寻找可执行文件diff
。获得它的一种方法是安装 cygwin。您不必使用 cygwin 中的 Emacs 即可使用diff
. 只需添加c:\cygwin\bin
(使用您的 cygwin 安装路径)%PATH%
并重新启动 emacs。
Now when you run ediff
, it will find diff.exe
in your %PATH%
.
现在当你运行时ediff
,它会diff.exe
在你的%PATH%
.
回答by ataylor
There isn't an executable for ediff
.
没有可执行文件ediff
。
ediff
is a lisp program that runs within emacs. If you would like to run it from the command line, take a look at this documentation.
ediff
是一个在 emacs 中运行的 lisp 程序。如果您想从命令行运行它,请查看此文档。