如何组合emacs中的两个冲突变体? [英] How do I combine the two variants of a conflict in emacs' emerge?

查看:186
本文介绍了如何组合emacs中的两个冲突变体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Emacs中使用 emerge ,我有一个这样的会话:

 << <<<<<资源* /,
522ADC9D14B2FD9D00F56BAD / * close_test_button@2x.png资源* /,
522ADCA014B2FDB100F56BAD / * test_failed.png资源* /,$中的$ a
522ADC9C14B2FD9D00F56BAD / * close_test_button.png b $ b 522ADCA114B2FDB100F56BAD / * test_failed@2x.png在资源* /,
>>>>>>>>在资源* /,
EC1633C114B2F3E3004B52E7 / * arrow@2x.png资源* /,
EC1633C214B2F3E3004B52E7 / * groups.png资源* /,$中的
$ b EC1633C014B2F3E3004B52E7 / * arrow.png b $ b EC1633C314B2F3E3004B52E7 / * groups@2x.png在资源* /,
####### Ancestor
======= end

我可以通过点击 a 选择变体 A B 或者我的键盘上的 b ,但是如何一个接一个地组合两个变体?

解决方案

只需在emerge缓冲区内使用 Ch m 即可查看当前模式的帮助。对于大多数模式而言,Emerge minor模式显示其帮助文本中的键绑定。



该帮助显示您可以插入变体A或B的内容: i a b ,所以您可以使用该功能插入当前未选择的任何变体。



您还可以切换从默认的快速模式到出现编辑模式直接编辑合并文本。在编辑模式下使用 Cc cc f 返回快速模式(因为在编辑模式下,所有emerge命令需要以 Cc Cc )。



Emerge手册有更多的细节:

M- : (信息(emacs)Emerge) RET



特别地,它解释了 x c 绑定的行为,它使用预定义的模板字符串将两个变体组合在一个步骤中:

M - : (信息(emacs)结合Emerge) RET



默认模板使用C预处理器条件语法,但是,您几乎肯定要覆盖它。您可以通过Emerge选项菜单或 emerge-set-combine-template 设置模板。对于模板语法,请参阅:

Ch v emerge-combine-versions-template kbd> RET


Using emerge in Emacs, I have a session like this:

<<<<<<< variant A
            522ADC9C14B2FD9D00F56BAD /* close_test_button.png in Resources */,
            522ADC9D14B2FD9D00F56BAD /* close_test_button@2x.png in Resources */,
            522ADCA014B2FDB100F56BAD /* test_failed.png in Resources */,
            522ADCA114B2FDB100F56BAD /* test_failed@2x.png in Resources */,
>>>>>>> variant B
            EC1633C014B2F3E3004B52E7 /* arrow.png in Resources */,
            EC1633C114B2F3E3004B52E7 /* arrow@2x.png in Resources */,
            EC1633C214B2F3E3004B52E7 /* groups.png in Resources */,
            EC1633C314B2F3E3004B52E7 /* groups@2x.png in Resources */,
####### Ancestor
======= end

I can select variant A or B by hitting a or b on my keyboard, but how do I combine both variants, one after the other?

解决方案

Just use C-hm within the emerge buffer to see the help for the current modes. As is typical for most modes, the Emerge minor mode displays its key bindings in this help text.

That help shows that you can insert the content of variant A or B with: ia and ib, so you can use that feature to insert whichever variant isn't currently selected.

You can also switch from the default 'fast' mode to emerge 'edit' mode to directly edit the merged text. Use C-cC-cf in edit mode to get back to fast mode (because in edit mode, all emerge commands need to be prefixed by C-cC-c).

The Emerge manual has more details:
M-: (info "(emacs) Emerge") RET

In particular, it explains the behaviour of the xc binding, which combines the two variants in a single step using a pre-defined template string:
M-: (info "(emacs) Combining in Emerge") RET

The default template uses C preprocessor conditional syntax, however, so you would almost certainly want to override that. You can set the template via the Emerge Options menu or with emerge-set-combine-template. For the template syntax see:
C-hv emerge-combine-versions-template RET

这篇关于如何组合emacs中的两个冲突变体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆