If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
GNU Emacs default bindings:
or, more verbosely
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 variableinitial-major-mode.In general you can create as many ‘scratch’ buffers as you want, and name them however you choose.
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-xwrite-fileRET) to choose a file where it should be saved.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: