|
5/24 |
2007/10/10-14 [Computer/SW/Editors/Emacs] UID:48289 Activity:low |
10/10 Anyone know emacs has a session saver? It drives me nuts to have to reload and restore. \_ I looked at this six or twelve months ago, and they do exist, but no one implementation seemed simple nor robust enough for my needs. Let me know if you find anything. -dans \_ run emacs in screen, never kill it! \_ emacsserver/emacsclient \_ What do these have to do with saving sessions? -- !OP \_ If you never 'quit' emacs, there is no need to 'save' sessions. \_ I have an idea. How about you do "kill -9" to kill emacs every time you want to quit it, then user M-x recover-session to restore it? you want to quit it, then use M-x recover-session to restore it? You might even map C-x C-c to do "kill -9" on itself, and add recover-session to you ~/.emacs. \_ Can't you just boot directly into emacOS and use the system suspend and restore functions? \_ The following works for me without having to do too much work: http://www.phys.ufl.edu/docs/emacs/emacs_423.html basically, add an entry to your .emacs and then do "M-x desktop-save <path>" for the very first time, and subsequent launch of emacs from <path> will auto reload previous files, buffers, history, etc. I have this setup in less than a minute. |
www.phys.ufl.edu/docs/emacs/emacs_423.html Saving Emacs Sessions You can use the Desktop library to save the state of Emacs from one session to another. Saving the state means that Emacs starts up with the same set of buffers, major modes, buffer positions, and so on that the previous Emacs session had. emacs' file: (desktop-load-default) (desktop-read) The first time you save the state of the Emacs session, you must do it manually, with the command M-x desktop-save. Once you have done that, exiting Emacs will save the state again--not only the present Emacs session, but also subsequent sessions. You can also save the state at any time, without exiting Emacs, by typing M-x desktop-save again. In order for Emacs to recover the state from a previous session, you must start it with the same current directory as you used when you started the previous session. This is because desktop-read looks in the current directory for the file to read. This means that you can have separate saved sessions in different directories; the directory in which you start Emacs will control which saved session to use. The variable desktop-files-not-to-save controls which files are excluded from state saving. Its value is a regular expression that matches the files to exclude. this is because visiting them again in the subsequent session would be slow. If you want to include these files in state saving, set desktop-files-not-to-save to "^$". |