Details of Package Session
Menus and Key-Bindings
For Emacs-21.1+ and XEmacs, this package defines the following menu entries and key-bindings:
- At the beginning of menu File, there are two new submenus: Open...recently changed and Open...recently visited.
- In menu Edit, there is a new submenu: Select and Paste, it already exists in Emacs-21+. With XEmacs, using the right mouse button C-button3 also pops up this submenu.
- Enter C-x C-/ or C-x Undo to jump to the position of the last change (use repeatedly or with prefix argument for earlier positions).
- In the minibuffer, enter M-? to display a completion list with all strings in the history for the current minibuffer input. From that list, you can use button2 to select an entry.
Saving Session Variables
There are various ways to control which lists/variables are saved in the session file and which elements in a list are included in the saved value:
- The variables to store can be specified by a regular expression matching their names, and by an include/exclude list.
- Variables containing empty lists are not stored. You do not want to clutter up your session file...
- Long lists can be truncated. A maximum length can be specified globally and individually for single variables.
- If there are equal elements in the list, only the first is saved. Long strings in a list can be excluded by specifying a maximal string length.
- Elements in a list which have no readable representation (e.g., events in the command history) are automatically dropped.
- To exit Emacs without writing a session file, use prefix argument 0: enter C-u 0 C-x C-c.
Technical detail: documentation of command
session-save-session
.
Note: you cannot share the same session file between Emacs and XEmacs (different coding systems, different types for the same variables, …).
Storing Buffer Places
Since not all buffers/files are of permanent interest, there are various conditions and means to control for which buffers to store some places:
- The buffer must visit a readable file. There are variables to exclude or include buffers due to their major mode or buffer file name.
- By default, the contents must have been changed. You still have the places from previous Emacs sessions, but that information is older and thus more likely to be truncated from the list of saved buffer places (see above).
- Individual control by providing a prefix argument to command M-x kill-this-buffer (C-u 2 or higher: store places, C-u 0 or lower: don't store places).
- A file/buffer can be marked as permanent, i.e., its places will always be stored. Use M-x session-toggle-permanent-flag or select the corresponding menu item in the new submenu Open...recently changed.
Technical detail: documentation of function
session-store-buffer-places
.