Emacs如何确定撤消的工作单位

Emacs如何确定撤消的工作单位

本文介绍了Emacs如何确定撤消的工作单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您输入命令时,Emacs将撤消您最近对缓冲区进行更改的一部分。当您再次输入时,它会撤消另一个工作。

When you enter the command , Emacs undoes some part of your recent changes to a buffer. When you enter again, it undoes another chunk of work.

我已经阅读了,但它的确是如何工作的,这是模糊的。该手册说连续字符插入命令通常被分组在一个单个撤销记录,但它并不解释如何决定构成组的字符插入命令的数量。一个组中的字符数似乎是随机的。

I have read the Emacs manual entry on Undo but it is vague about exactly how it works. The manual says "Consecutive character insertion commands are usually grouped together into a single undo record" but it does not explain how it decides the number of character insertion commands that constitute a group. The number of characters it puts in a group seems random.

任何人都可以解释Emacs用于将字符分组到撤销记录中的算法?

Can anyone explain the algorithm Emacs uses to group characters into undo records?

推荐答案

设置撤消边界的逻辑主要在 self-insert-command = http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/src/cmds.c> cmds.c 。您必须阅读完整故事的代码,但基本上:

The logic for setting undo boundaries is mostly in self-insert-command which is implemented in cmds.c. You'll have to read the code for the full story, but basically:

这篇关于Emacs如何确定撤消的工作单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!