Every day I start up emacs and open the exact same files I had open the day before. Is there something I can add to init.el file so it will reopen all the buffers I was using when I last quit emacs?
http://www.phys.ufl.edu/docs/emacs/emacs_423.html may have what you need
You can use the Emacs Desktop library:
You can save the desktop manually with the command M-x desktop-save. You can also enable automatic saving of the desktop when you exit Emacs, and automatic restoration of the last saved desktop when Emacs starts: use the Customization buffer (see Easy Customization) to set desktop-save-mode to t for future sessions, or add this line in your ~/.emacs file:
(desktop-save-mode 1)
You can open files in your .emacs file by using the following function:
(find-file "/home/me/path-to-file")
Although I suspect the question was looking for the emacs "desktop" functionality (see above answer), Lewap's approach can be useful if the set of files one uses really is the exact same file set. In fact, one can go a step further and define 'profiles' if one has different sets of regularly used files... Quickie example:
(let ((profile
(read-from-minibuffer "Choose a profile (acad,dist,lisp,comp,rpg,sqlg,ssqlfs,tl,tc,fpu): ")
))
(cond
((string-match "acad" profile)
(dired "/home/thomp/academic")
(dired "/home/thomp/academic/papers")
)
((string-match "lisp" profile)
(setup-slime)
(lisp-miscellany)
(open-lisp-dirs)
)
((string-match "rpg" profile)
(find-file "/home/thomp/computing/lisp/rp-geneval/rp-geneval/rp-geneval.lisp")
(dired "/home/thomp/computing/lisp/rp-geneval/rp-geneval")
(dired "/home/thomp/academic/data")
... etc.
Seems that desktop handling is different in Emacs 21 and 22+. The topic is described on this page: http://www.emacswiki.org/emacs/DeskTop .
There are useful enhancements you can make to the basic desktop feature. Particular handy (IMO) are methods of auto-saving the desktop during the session, as otherwise if your system crashes you will be stuck with the desktop file you had started that session with -- pretty annoying if you tend to keep Emacs running for many days at a time.
http://www.emacswiki.org/emacs/DeskTop
The wiki also has useful information about persisting data between sessions in general:
http://www.emacswiki.org/emacs/SessionManagement
For desktops specifically, I thought that Desktop Recover looked particularly promising, however I've not yet tried it out.