Skip to main content
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-...
Tobias's user avatar
  • 33.7k
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. ...
lawlist's user avatar
  • 19.5k
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 ...
db48x's user avatar
  • 19.1k
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*&...
nunop's user avatar
  • 136
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 ...
Swarnendu Biswas's user avatar
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-...
unhammer's user avatar
  • 1,231
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 ...
Drew's user avatar
  • 79.1k

Only top scored, non community-wiki answers of a minimum length are eligible