Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to assign a file (~/tmp/scratch) to the *scratch* buffer in Emacs.

When I open Emacs I would like ~/tmp/scratch to be opened (preferably in the buffer named *scratch*) and when Emacs is closed the content should be saved to ~/tmp/scratch.

share|improve this question
add comment

1 Answer 1

See this article : How to Make Emacs' Scratch Buffer Persistent Across Sessions.

This article contains the code to put in the .emacs or .emacs.d/init.el file, which will declare the file containing the scratch buffer, load the buffer on startup and save on shutdown.

The code is a bit too voluminous to reproduce here. You should also read the comments to the article.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.