当我在 Emacs 中搜索“save-restriction”的描述时,它有一个关于“缓冲区限制”的句子——我在下面包含了完整的描述。这个词是什么意思?保存限制是如何工作的,考虑到这一点,何时应该使用它?
(save-restriction &rest BODY)
Execute BODY, saving and restoring current buffer's restrictions.
The buffer's restrictions make parts of the beginning and end invisible.
(They are set up with `narrow-to-region' and eliminated with `widen'.)
This special form, `save-restriction', saves the current buffer's restrictions
when it is entered, and restores them when it is exited.
So any `narrow-to-region' within BODY lasts only until the end of the form.
The old restrictions settings are restored
even in case of abnormal exit (throw or error).
The value returned is the value of the last form in BODY.