diff options
author | rcyeske <rcyeske> | 2001-02-26 00:31:49 +0000 |
---|---|---|
committer | rcyeske <rcyeske> | 2001-02-26 00:31:49 +0000 |
commit | ca8d87a00c097cf1fa5a1c9c12333831f34e32ab (patch) | |
tree | 8556cd09a69631fa6e9c3b357435ab6497d008b1 /src | |
parent | 85158fa1ccb413a66a2ad62e3b6330a2ecb478da (diff) | |
download | ratpoison-ca8d87a00c097cf1fa5a1c9c12333831f34e32ab.zip |
added cmd_source
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 11 | ||||
-rw-r--r-- | src/actions.c | 13 | ||||
-rw-r--r-- | src/actions.h | 1 | ||||
-rw-r--r-- | src/main.c | 10 | ||||
-rw-r--r-- | src/ratpoison.h | 2 |
5 files changed, 29 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c1dd9bf..c51083a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-02-25 Ryan Yeske <rcyeske@cut.hotdog.tmp> + + * main.c (read_rc_file): rename from load_rc_file. Remove static + keyword. + + * actions.c (cmd_prev): Handle situation when there is no other + window. + (cmd_next): Likewise. + (cmd_other): Likewise. + (cmd_source): New function. + 2001-02-24 Ryan Yeske <rcyeske@cut.hotdog.tmp> * main.c (load_rc_file): new function diff --git a/src/actions.c b/src/actions.c index 0d8f2b7..10779d4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -150,6 +150,7 @@ user_command user_commands[] = {"generate", cmd_generate, arg_STRING}, /* rename to stuff */ {"version", cmd_version, arg_VOID}, {"bind", cmd_bind, arg_VOID}, + {"source", cmd_source, arg_STRING}, /* the following screen commands may or may not be able to be implemented. See the screen documentation for what should be @@ -260,6 +261,12 @@ cmd_unimplemented (void *data) } void +cmd_source (void *data) +{ + read_rc_file ((char*)data); +} + +void cmd_generate (void *data) { XEvent ev1, ev; @@ -317,7 +324,7 @@ cmd_prev (void *data) { w = find_window_prev (rp_current_window); - if (w == rp_current_window) + if (!w) message (MESSAGE_NO_OTHER_WINDOW); else set_active_window (w); @@ -335,7 +342,7 @@ cmd_next (void *data) { w = find_window_next (rp_current_window); - if (w == rp_current_window) + if (!w) message (MESSAGE_NO_OTHER_WINDOW); else set_active_window (w); @@ -349,7 +356,7 @@ cmd_other (void *data) w = find_window_other (); - if (w == rp_current_window) + if (!w) message (MESSAGE_NO_OTHER_WINDOW); else set_active_window (w); diff --git a/src/actions.h b/src/actions.h index 4cf155b..6db0c01 100644 --- a/src/actions.h +++ b/src/actions.h @@ -60,6 +60,7 @@ void cmd_clock (void *data); void cmd_version (void *data); void cmd_unimplemented (void *data); void cmd_bind (void* data); +void cmd_source (void* data); /* void cmd_xterm (void *data); */ @@ -177,8 +177,8 @@ print_help () exit (EXIT_SUCCESS); } -static void -load_rc_file (char *filename) +void +read_rc_file (char *filename) { FILE *rcfile; @@ -225,7 +225,7 @@ load_rc_file (char *filename) } static void -read_initialization_files () +read_startup_files () { char *homedir; @@ -237,7 +237,7 @@ read_initialization_files () { char *rcfile = (char*)malloc (strlen (homedir) + strlen ("/.ratpoisonrc") + 1); sprintf (rcfile, "%s/.ratpoisonrc", homedir); - load_rc_file (rcfile); + read_rc_file (rcfile); } } @@ -345,7 +345,7 @@ main (int argc, char *argv[]) initialize_default_keybindings (); - read_initialization_files (); + read_startup_files (); /* Set an initial window as active. */ set_active_window (find_window_other ()); diff --git a/src/ratpoison.h b/src/ratpoison.h index 7567588..00920db 100644 --- a/src/ratpoison.h +++ b/src/ratpoison.h @@ -61,4 +61,6 @@ extern XGCValues gv; void clean_up (); screen_info *find_screen (Window w); +void read_rc_file (char *filename); + #endif /* ! _RATPOISON_H */ |