* doc/emacs/building.texi (Lisp Interaction): Mention it.
* lisp/simple.el (scratch-buffer): New command.
Its major mode is Lisp Interaction mode. You can also enable Lisp
Interaction mode by typing @kbd{M-x lisp-interaction-mode}.
+@findex scratch-buffer
+ If you kill the @file{*scratch*} buffer, you can recreate it with
+the @kbd{M-x scratch-buffer} command.
+
@findex eval-print-last-sexp
@kindex C-j @r{(Lisp Interaction mode)}
In the @file{*scratch*} buffer, and other Lisp Interaction mode
\f
* Changes in Specialized Modes and Packages in Emacs 29.1
+** Miscellaneous
+
++++
+*** New command 'scratch-buffer'.
+This switches to the *scratch* buffer. If it doesn't exist, create it
+first.
+
** Debugging
*** New user option 'debug-allow-recursive-debug'.
the number of seconds east of Greenwich.")
)
+(defun scratch-buffer ()
+ "Switch to the \*scratch\* buffer.
+If the buffer doesn't exist, create it first."
+ (interactive)
+ (if (get-buffer "*scratch*")
+ (pop-to-buffer-same-window "*scratch*")
+ (pop-to-buffer-same-window (get-buffer-create "*scratch*"))
+ (when initial-scratch-message
+ (insert initial-scratch-message))
+ (funcall initial-major-mode)))
+
\f
(provide 'simple)