Function: scratch-buffer

scratch-buffer is an interactive and byte-compiled function defined in simple.el.gz.

Signature

(scratch-buffer)

Documentation

Switch to the *scratch* buffer.

If the buffer doesn't exist, create it first.

View in manual

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun scratch-buffer ()
  "Switch to the *scratch* buffer.
If the buffer doesn't exist, create it first."
  (interactive)
  (pop-to-buffer-same-window (get-scratch-buffer-create)))