Add a function for switching to the scratch buffer
This commit is contained in:
parent
4f555baf3c
commit
f2fe785a1a
10
init.el
10
init.el
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user