手册中说,如果你顺序使用kill-region,你杀死的文本将在kill-ring中连接成一个。
我只是很困惑这是如何工作的。所以我试图在暂存缓冲区中对此进行评估:
(progn
(kill-region 1 5) ; this kills ";; T"
(kill-region 1 5)); this kills "his "
我期望的是,由于我使用了 kill-region 2 次,因此被杀死的文本应该在 kill-ring 中连接为一个。
但是当我使用 Cy 时,我只得到“他的”。
所以我在这里有两个问题:
在 lisp 中,如何多次调用 kill-region 以便连接被杀死的文本?
使用键盘 Cw,如何多次调用 kill-region 以便连接被杀死的文本?因为典型的工作流程是 kill-region(Cw),然后是 move-cursor,然后是 kill-region。
这是杀死区域的文档字符串。第二段和最后一段不是矛盾的吗?
"Kill (\"cut\") text between point and mark.
This deletes the text from the buffer and saves it in the kill ring.
The command \\[yank] can retrieve it from there.
\(If you want to save the region without killing it, use \\[kill-ring-save].)
If you want to append the killed region to the last killed text,
use \\[append-next-kill] before \\[kill-region].
If the buffer is read-only, Emacs will beep and refrain from deleting
the text, but put the text in the kill ring anyway. This means that
you can use the killing commands to copy text from a read-only buffer.
Lisp programs should use this function for killing text.
(To delete text, use `delete-region'.)
Supply two arguments, character positions indicating the stretch of text
to be killed.
Any command that calls this function is a \"kill command\".
If the previous command was also a kill command,
the text killed this time appends to the text killed last time
to make one entry in the kill ring."