diff -Naur ratpoison-1.3.0.orig/doc/ratpoison.texi ratpoison-1.3.0/doc/ratpoison.texi --- ratpoison-1.3.0.orig/doc/ratpoison.texi 2004-05-20 02:12:37.000000000 -0400 +++ ratpoison-1.3.0/doc/ratpoison.texi 2004-07-01 11:27:21.381256528 -0400 @@ -586,7 +586,8 @@ @end deffn @deffn Command only -Kill all frames but the current one. +Kill all frames but the current one. The current frameset can be +restored with the @command{frestore} command. @end deffn @deffn Command split @var{n} @@ -752,7 +753,9 @@ @deffn Command frestore @var{frames} Restore the frame layout based on the list of frames @var{frames}. @var{frames} should be the text that was printed after -calling @code{fdump}. +calling @code{fdump}. This command will also restore the frame layout +that was in effect prior to the last @command{only} (@kbd{C-t Q}) +command. @end deffn @node Multiple Monitors, Keystrokes, Frames, Top diff -Naur ratpoison-1.3.0.orig/src/actions.c ratpoison-1.3.0/src/actions.c --- ratpoison-1.3.0.orig/src/actions.c 2004-05-20 01:33:47.000000000 -0400 +++ ratpoison-1.3.0/src/actions.c 2004-07-01 11:40:08.108696240 -0400 @@ -32,6 +32,9 @@ /* rp_keymaps is ratpoison's list of keymaps. */ LIST_HEAD(rp_keymaps); +/* keep track of the last frameset after :only. */ +static char *last_frameset = NULL; + static user_command user_commands[] = { /address@hidden (tag required for genrpbindings) */ {"abort", cmd_abort, arg_VOID}, @@ -471,6 +474,8 @@ add_keybinding (XK_r, 0, "resize", map); add_keybinding (XK_r, RP_CONTROL_MASK, "resize", map); add_keybinding (XK_question, 0, "help " ROOT_KEYMAP, map); + add_keybinding (XK_Escape, RP_CONTROL_MASK, "frestore", map); + add_keybinding (XK_Escape, 0, "frestore", map); add_alias ("unbind", "definekey " ROOT_KEYMAP); add_alias ("bind", "definekey " ROOT_KEYMAP); @@ -1702,6 +1707,11 @@ char * cmd_only (int interactive, char *data) { + /* Save the current frameset so that we can return to it later */ + if (last_frameset != NULL) + free(last_frameset); + last_frameset = cmd_fdump(0, NULL); + remove_all_splits(); maximize (current_window()); @@ -3484,8 +3494,12 @@ if (data == NULL) { - message (" frestore: one argument required "); - return NULL; + data = last_frameset; + if (data == NULL) + { + message (" frestore: no previous frameset to restore "); + return NULL; + } } INIT_LIST_HEAD (&fset);