1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>J User's Guide - Sessions</title> |
---|
5 | <LINK REL="stylesheet" HREF="j.css" TYPE="text/css"> |
---|
6 | </head> |
---|
7 | <body> |
---|
8 | <a href="contents.html">Top</a> |
---|
9 | <hr> |
---|
10 | <h1>Sessions</h1> |
---|
11 | <hr> |
---|
12 | <p> |
---|
13 | By default, information about your editing session is saved so that when you |
---|
14 | restart j, things come back more or less as you left them: the same buffers |
---|
15 | will be open (except for remote and transient buffers), and the current |
---|
16 | location in each buffer will be the same. |
---|
17 | </p> |
---|
18 | <p> |
---|
19 | J also provides support for named sessions with the commands |
---|
20 | <a href="commands.html#saveSession">saveSession</a> and |
---|
21 | <a href="commands.html#loadSession">loadSession</a>. |
---|
22 | </p> |
---|
23 | <p> |
---|
24 | <a href="commands.html#saveSession">saveSession</a> saves information about |
---|
25 | the current editing session in a named session file. If no named session is |
---|
26 | active yet, you will be prompted for a name for the current session; |
---|
27 | subsequent saves will go to that session file without further prompting. |
---|
28 | </p> |
---|
29 | <p> |
---|
30 | <a href="commands.html#loadSession">loadSession</a> loads a previously saved |
---|
31 | named session, which then becomes the active named session as far as |
---|
32 | <a href="commands.html#saveSession">saveSession</a> is concerned. All |
---|
33 | currently open buffers are closed before the new session is loaded. |
---|
34 | </p> |
---|
35 | <p> |
---|
36 | If a named session is active, you can save the current session under a new |
---|
37 | name by using <a href="commands.html#executeCommand">executeCommand</a> to |
---|
38 | invoke <a href="commands.html#saveSession">saveSession</a> with the new name |
---|
39 | as an argument (e.g. Alt X, "saveSession foo"). If you do this, subsequent |
---|
40 | saves will go to the new session file by default. |
---|
41 | </p> |
---|
42 | <p> |
---|
43 | When a named session is active, the session name appears in the title bar of |
---|
44 | the top-level window, enclosed in brackets. |
---|
45 | </p> |
---|
46 | <p> |
---|
47 | By default, the information in a named session file is only updated when you |
---|
48 | explicitly invoke <a href="commands.html#saveSession">saveSession</a>. This |
---|
49 | allows you to exercise better control over the contents of named session |
---|
50 | files. If you'd like named session information to be updated automatically, |
---|
51 | add this line to ~/.j/prefs or C:\.j\prefs: |
---|
52 | <pre> |
---|
53 | autosaveNamedSessions = true</pre> |
---|
54 | <p> |
---|
55 | You can use "-session" on the command line to start j with a specific named |
---|
56 | session: |
---|
57 | <pre> |
---|
58 | j -session foo</pre> |
---|
59 | or |
---|
60 | <pre> |
---|
61 | java -jar j.jar -session foo</pre> |
---|
62 | <p> |
---|
63 | When you start j without specifying a named session on the command line, the |
---|
64 | previous session is restored, but no named session is active until you do |
---|
65 | <a href="commands.html#saveSession">saveSession</a> or |
---|
66 | <a href="commands.html#loadSession">loadSession</a>. |
---|
67 | </p> |
---|
68 | <p> |
---|
69 | Named session files are stored in the directory ~/.j/sessions (or |
---|
70 | C:\.j\sessions). You might want to visit that directory on your day off and |
---|
71 | delete session files that are no longer needed. |
---|
72 | </p> |
---|
73 | </body> |
---|
74 | </html> |
---|