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

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

问题描述

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

解决方案

GNU Emacs默认绑定:


Cx b * scratch * RET


或更详细地


Mx switch-to-buffer * scratch * / code> RET


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



一般来说,您可以根据需要创建尽可能多的暂存缓冲区,并将其命名为


cx b NAME RET


切换到缓冲区 NAME ,如果不存在则创建它。在您使用 Cx Cw (或 Mx 写入文件之前,新的缓冲区不与磁盘上的文件相关联/ code> RET )选择要保存的文件。


Mx text-mode RET


将当前缓冲区的主模式更改为文本模式。要查找所有可用的模式(也就是说,不需要任何新软件包),您可以输入以下内容来获取列表:


Mx apropos-command -mode $ RET



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

解决方案

GNU Emacs default bindings:

C-xb *scratch* RET

or, more verbosely

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

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

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天全站免登陆