在 Emacs 中重新打开 *scratch* 缓冲区? [英] Re-open *scratch* buffer in Emacs?

查看:26
本文介绍了在 Emacs 中重新打开 *scratch* 缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我不小心关闭了 Emacs 中的 scratch 缓冲区,我该如何创建一个新的 scratch 缓冲区?

If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?

推荐答案

GNU Emacs 默认绑定:

GNU Emacs default bindings:

C-xb *scratch* RET

或者更详细的

M-x switch-to-buffer *scratch* RET

*scratch* 缓冲区是启动时选择的缓冲区,主要模式为 Lisp 交互.注意:*scratch* 缓冲区的模式由变量 initial-major-mode.

The *scratch* buffer is the buffer selected upon startup, and has the major mode Lisp Interaction. Note: the mode for the *scratch* buffer is controlled by the variable initial-major-mode.

通常,您可以根据需要创建任意数量的暂存"缓冲区,并根据需要为其命名.

In general you can create as many "scratch" buffers as you want, and name them however you choose.

C-xb NAME RET

切换到缓冲区 NAME,如果它不存在则创建它.在您使用 CxCw(或 Mx write-fileRET) 选择一个文件应该保存在那里.

switches to a buffer NAME, creating it if it doesn't exist. A new buffer is not associated with a file on disk until you use C-xC-w (or M-x write-file RET) to choose a file where it should be saved.

M-x text-mode RET

将当前缓冲区的主要模式更改为文本模式.要查找所有可用模式(即不需要任何新包),您可以通过键入以下内容获取列表:

changes the current buffer's major mode to Text mode. To find all the modes available (that is, without requiring any new packages), you can get a list by typing:

M-x apropos-command -mode$ RET

这篇关于在 Emacs 中重新打开 *scratch* 缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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