# 32 文本

本章将介绍处理缓冲区内文本的函数．大多数的检查，插入，以及删除操作都发生在某个位置点附近的文本．其中很多函数都是可交互的．所有的修改文本的函数都提供一个对应的撤回操作．

很多文本相关的函数都需要接收两个参数，用来确定它们作用的文本范围．这个两个参数分别是　起始点（start）和结束点（end）．这两个参数应当是 标记，或作为数字字符解释的位置．这两个参数的位置并不重要．你可以把 start 当作 end 参数传入，也可以把 end 当成 start 的参数传入．举个例子, (delete-region 1 10) 和 (delete-region 10 1) 是等价的. 不过,如果其中任一参数如果超出了缓冲区的编辑范围,那么 Emcas 会抛出 args-out-of-range 错误.如果交互式地调用这些函数,那么它们会默认使用 当前位置 (point) 和 标记 (mark) 作为参数传入.

"文本" (text) 是指缓冲区的字符, 以及这些字符相关的属性, 这个概念将贯穿本章. 另外请牢记, 位置点 (point) 是指两个字符中间的那个空隙, 而 Emacs 中的光标总处在位置点后面一位的那个字符上.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emacs-lisp.ivory.cafe/wen-ben/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
