比较文档各部分的 Emacs 技术?
我希望能够在 Emacs 中打开两个窗口,在每个窗口中选择一个文本区域,然后比较两个选择之间的差异。
这对于大型维护项目来说非常方便,在该项目中,我正在处理具有多个分支、大量复制/粘贴以及偶尔移动的代码的版本树。
我找到了一个确实提供此功能的付费工具(Ultracompare ),但它是特定于 Windows 的,我需要一个在 Solaris/Linux 上运行的解决方案。
I'd like to be able to open two windows in Emacs, select a region of text in each window, and get a comparison of the difference between the two selections.
This would be very handy for a large-scale maintenance project, where I'm working on a version tree with multiple branches, lots of copy/paste, and code that is being moved around sporadically.
I've found a paid-for tool that does provide this function (Ultracompare), but it's windows-specific, and I need a solution that runs on Solaris/Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 Mx ediff-regions-wordwise 可以满足您的要求。
运行 ediff-regions-wordwise ,Emacs 将提示每个缓冲区,然后提示您选择(或确认)缓冲区中的一个区域。
而且,额外的是,Emacs 也可以在 Windows 上运行!
I think M-x ediff-regions-wordwise does what you want.
Run
ediff-regions-wordwise
and Emacs will prompt for each buffer, then prompt you to select (or confirm) a region in the buffer.And, bonus, Emacs runs on Windows too!
我倾向于在两个缓冲区中使用
narrow-to-region
(Cx nn),然后使用Mx Compare-windows
,因为它至少对我有用100 年。 :-)I'd be inclined to use
narrow-to-region
(C-x n n) in both buffers followed byM-x compare-windows
if only because it has worked for me for at least 100 years. :-)