1

Add a function for switching to the scratch buffer

This commit is contained in:
Jessie Hildebrandt 2020-07-20 20:03:35 -04:00
parent 4f555baf3c
commit f2fe785a1a

10
init.el
View File

@ -48,6 +48,16 @@
;; Variables/Basic Config. ;; Variables/Basic Config.
;;==================== ;;====================
;; Define an interactive function for switching to the scratch buffer, (re)creating it if not present.
(defun switch-to-scratch-buffer ()
"Switch to the scratch buffer, (re)creating it if not present."
(interactive)
(if (get-buffer "*scratch*")
(switch-to-buffer "*scratch*")
(progn
(switch-to-buffer (get-buffer-create "*scratch*"))
(lisp-interaction-mode))))
;; Basic variable configuration. ;; Basic variable configuration.
(setq-default (setq-default
initial-scratch-message "" ; Remove initial message initial-scratch-message "" ; Remove initial message