/[ratpoison]/ratpoison/src/actions.c
ViewVC logotype

Diff of /ratpoison/src/actions.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.209 by sabetts, Wed Nov 17 18:53:49 2004 UTC revision 1.210 by sabetts, Thu Nov 18 21:39:21 2004 UTC
# Line 51  static user_command user_commands[] = Line 51  static user_command user_commands[] =
51      {"exec",            cmd_exec,               arg_STRING},      {"exec",            cmd_exec,               arg_STRING},
52      {"fdump",           cmd_fdump,              arg_STRING},      {"fdump",           cmd_fdump,              arg_STRING},
53      {"focus",           cmd_next_frame,         arg_VOID},      {"focus",           cmd_next_frame,         arg_VOID},
54        {"focusprev",       cmd_prev_frame,         arg_VOID},
55      {"focusdown",       cmd_focusdown,          arg_VOID},      {"focusdown",       cmd_focusdown,          arg_VOID},
56      {"focuslast",       cmd_focuslast,          arg_VOID},      {"focuslast",       cmd_focuslast,          arg_VOID},
57      {"focusleft",       cmd_focusleft,          arg_VOID},      {"focusleft",       cmd_focusleft,          arg_VOID},
# Line 851  cmd_meta (int interactive, char *data) Line 852  cmd_meta (int interactive, char *data)
852  char *  char *
853  cmd_prev (int interactive, char *data)  cmd_prev (int interactive, char *data)
854  {  {
855    if (!current_window())    rp_window *cur, *win;
856      {    cur = current_window();
857        set_active_window (group_prev_window (rp_current_group, NULL));    win = group_prev_window (rp_current_group, cur);
858        if (!current_window())  
859          message (MESSAGE_NO_MANAGED_WINDOWS);    if (win)
860      }      set_active_window (win);
861      else if (cur)
862        message (MESSAGE_NO_OTHER_WINDOW);
863    else    else
864      {      message (MESSAGE_NO_MANAGED_WINDOWS);
       rp_window *win;  
   
       win = group_prev_window (rp_current_group, current_window());  
       if (win == NULL)  
         message (MESSAGE_NO_OTHER_WINDOW);  
       else  
         set_active_window (win);  
     }  
865    
866    return NULL;    return NULL;
867  }  }
# Line 876  cmd_prev_frame (int interactive, char *d Line 871  cmd_prev_frame (int interactive, char *d
871  {  {
872    rp_frame *frame;    rp_frame *frame;
873    
874    frame = find_frame_next (current_frame());    frame = find_frame_prev (current_frame());
875    if (!frame)    if (!frame)
876      message (MESSAGE_NO_OTHER_FRAME);      message (MESSAGE_NO_OTHER_FRAME);
877    else    else
# Line 888  cmd_prev_frame (int interactive, char *d Line 883  cmd_prev_frame (int interactive, char *d
883  char *  char *
884  cmd_next (int interactive, char *data)  cmd_next (int interactive, char *data)
885  {  {
886    if (!current_window())    rp_window *cur, *win;
887      {    cur = current_window();
888        set_active_window (group_next_window (rp_current_group, NULL));    win = group_next_window (rp_current_group, cur);
889        if (!current_window())  
890          message (MESSAGE_NO_MANAGED_WINDOWS);    if (win)
891      }      set_active_window (win);
892      else if (cur)
893        message (MESSAGE_NO_OTHER_WINDOW);
894    else    else
895      {      message (MESSAGE_NO_MANAGED_WINDOWS);
       rp_window *win;  
   
       win = group_next_window (rp_current_group, current_window());  
       if (win == NULL)  
         message (MESSAGE_NO_OTHER_WINDOW);  
       else  
         set_active_window (win);  
     }  
896    
897    return NULL;    return NULL;
898  }  }
# Line 3756  cmd_frestore (int interactively, char *d Line 3745  cmd_frestore (int interactively, char *d
3745    
3746        PRINT_DEBUG (("restore %d %d\n", cur->number, cur->win_number));        PRINT_DEBUG (("restore %d %d\n", cur->number, cur->win_number));
3747    
3748          /* Grab the frame's number, but if it already exists request a
3749             new one. */
3750          if (!numset_add_num (s->frames_numset, cur->number)) {
3751            cur->number = numset_request (s->frames_numset);
3752          }
3753    
3754        /* Find the current frame based on last_access. */        /* Find the current frame based on last_access. */
3755        if (cur->last_access > max)        if (cur->last_access > max)
3756          {          {
# Line 3763  cmd_frestore (int interactively, char *d Line 3758  cmd_frestore (int interactively, char *d
3758            max = cur->last_access;            max = cur->last_access;
3759          }          }
3760    
       /* Grab the frame's number, but if it already exists request a  
          new one. */  
       if (!numset_add_num (s->frames_numset, cur->number)) {  
         cur->number = numset_request (s->frames_numset);  
       }  
   
3761        /* Update the window the frame points to. */        /* Update the window the frame points to. */
3762        if (cur->win_number != EMPTY)        if (cur->win_number != EMPTY)
3763          {          {

Legend:
Removed from v.1.209  
changed lines
  Added in v.1.210

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26