Commit 39b4a515 authored by Guilherme Semente's avatar Guilherme Semente 🌱

Make scratch buffer persistent

parent 85045679
......@@ -83,8 +83,15 @@ user)."
(interactive)
(if (active-minibuffer-window)
(select-window (active-minibuffer-window))
(error "Minibuffer is not active"))))
(error "Minibuffer is not active")))
(defun semente-switch-to-scratch-buffer (&optional arg)
(interactive)
(if (get-buffer "*scratch*")
(switch-to-buffer "*scratch*")
(find-file "~/scratch")
(funcall initial-major-mode)
(rename-buffer "*scratch*"))))
(progn
......@@ -127,9 +134,16 @@ You may find other key bindings inside use-package statements."
auto-save-interval 100)
(setq inhibit-startup-screen t
initial-buffer-choice nil
initial-major-mode 'lisp-interaction-mode)
(setq initial-buffer-choice
(lambda ()
(switch-to-buffer "*scratch*")
;; see also semente-maybe-bury-kill-buffer-query-function
(kill-buffer (rename-buffer "*scratch*<bypass-maybe-bury>" t))
(semente-switch-to-scratch-buffer)
(get-buffer "*scratch*")))
(setq visible-bell t ; no beep!
completion-show-help nil
column-number-mode t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment