4
votes
Accepted
I've modified "initial-scratch-message" -- what else must I do to see it effected?
In step 23 of the startup sequence emacs inserts initial-scratch-message into the *scratch* buffer.
That step is after loading the init file, after running after-init-hook, and before emacs-startup-...
3
votes
Can't get rid of scratch buffer at startup for Emacs 26.3
I battled with this phenomenon for years and discovered that Emacs automatically recreates a scratch buffer if there are no other buffers. In addition, Emacs creates a scratch buffer on startup. ...
3
votes
Accepted
I need to restore the *scratch* buffer from the last time I used emacs even though I killed it and had to restart
Buffers that are not saved to a file are just kept in memory. The contents of memory are lost on a reboot¹, so these buffers are gone. If you had a core dump, or a copy of your memory (such as you ...
2
votes
Accepted
How to prevent `*scratch*` or `*Messages*` buffer to show up when I open via `emacs -Q`?
This should do it:
;; Remove messages from the *Messages* buffer.
(setq-default message-log-max nil)
;; Kill both buffers on startup.
(kill-buffer "*Messages*")
(kill-buffer "*scratch*&...
2
votes
Accepted
Ask for saving contents if scratch buffer is modified before exit
persistent-scratch is another package which saves and restores the contents of the *scratch* buffer. The following is a possible setup.
(use-package persistent-scratch
:ensure t
:commands ...
2
votes
Ask for saving contents if scratch buffer is modified before exit
You could use the (bundled) savehist package to save and restore the scratch contents:
(use-package savehist
:init
(savehist-mode)
:config
(defun my-savehist-scratch ()
(with-current-...
2
votes
Ask for saving contents if scratch buffer is modified before exit
This is a commonly asked question. It might be a duplicate here (dunno). There are various tweaks or libraries that some users use to provide what you are asking - you will likely get some answers ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scratch × 5scratch-buffer × 2
init-file × 1
window × 1
emacsclient × 1
saving × 1
exit × 1
persistence × 1
recover × 1
ergoemacs × 1