# read-session(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

read-session - Read in session information

## SYNOPSIS

n read-session [ "session-file" ]

## DESCRIPTION

read-session reads in a MicroEmacs 2009 session file, setting the current session information. If argument n is not given then the given "session-file" is simply read in. If a non-zero argument is specified then default session is set to the given file-name and the file is read. If an argument of zero is given then the default session is re-read. Information read in (and saved) from the history file includes:-

- Searching and replacing history.
- Buffer name history.
- Command name history.
- File name history.
- General (all the rest) history.
- Buffer and file list with line numbers.

MicroEmacs 2009's environment may be retained almost intact by the use of the default session and using the -c (continue) command-line option to re-load all files that were being edited in a previous session.

On loading a new session then the user is prompted to save the current session. If the numeric argument is zero (bit 0 is 0) then the user is not prompted and the session-file is effectively loaded and merged into the current session.

## NOTES

When running multiple MicroEmacs 2009 sessions on the same work-station (or different workstations sharing the same home directory), the default history is saved when MicroEmacs 2009 exits. As a result the last MicroEmacs 2009 sessions that terminates writes the history information used next time.

The session information is saved in a registry format file (see esf(8)). Reference should be made to the notes included in erf(8) as to how the history file may be edited and effected in the same MicroEmacs 2009 session.

The user may now have multiple sessions, this is useful when one is working on different projects, the sessions are created using save-session(3) using a new session name. Starting the editor with a different session means that the hilighting scheme may be different between different sessions i.e. "Blue Hue" and "Sherwoord Forest". Note that the color scheme should be changed with change-scheme(3) and not with user-setup(3) if different sessions are to use different color schemes.

## Command Line

Reading a session is generally performed when a MicroEmacs session is started using the "-c" command line option rather than from the emacs mode line or main menu, see me(1). Invoking

me -c<mySessionName>

where <mySessionName> is the name of the session (the $MENAME(5) or system login name) will restore all of of the buffers, windows layout, point and mark positions, main window size etc. at the point of the last shut down. e.g. given a system login name of jasspa then

me -c jasspa

restores the session to the state when jasspa last exited MicroEmacs. When the session name is specified then no other files should be specified, so the command line

me -c jasspa `morefiles.txt`

restores the buffers but does not restore the window layout because this has been destroyed by the introduction of the new file "`morefiles.txt`". This type of command with another file behaves as the old "`me -c`" command prior to the 2006 release that did not support sessions. If <mySessionName> is not specified then the buffers are restored but the window layout is not restored.

## SEE ALSO

change-scheme(3), erf(8), esf(8), @h0(4), me(1), $MENAME(5), save-session(3).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>