summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-09-13 11:14:29 +0000
committersabetts <sabetts>2001-09-13 11:14:29 +0000
commit73f336b75de79e011842bb5f4851c2e5169c76ab (patch)
treeb13c57e9f8bdf19eed171ad4473eb343523dc49b
parentd5b04e0048b0f1bd5a3d5a8f6c5f49aecab5ed64 (diff)
downloadratpoison-73f336b75de79e011842bb5f4851c2e5169c76ab.zip
(command): Gobble the whitespace between the
command and the argument list. Code that did this in specific commands has been removed. (cmd_setenv): new function (cmd_meta): rename from cmd_generate. All dependant code updated. (cmd_redisplay): rename from cmd_maximize. All dependant code updated. (initialize_default_keybindings): bind "redisplay" to C-t l and C-t c-l. (cmd_msgwait): rename from cmd_defbartimeout. All dependant code updated.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS10
-rw-r--r--src/actions.c70
-rw-r--r--src/actions.h7
4 files changed, 66 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 34a0a07..9e02de2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,14 @@
* src/actions.c (command): Gobble the whitespace between the
command and the argument list. Code that did this in specific
commands has been removed.
+ (cmd_setenv): new function
+ (cmd_meta): rename from cmd_generate. All dependant code updated.
+ (cmd_redisplay): rename from cmd_maximize. All dependant code
+ updated.
+ (initialize_default_keybindings): bind "redisplay" to C-t l and
+ C-t c-l.
+ (cmd_msgwait): rename from cmd_defbartimeout. All dependant code
+ updated.
* src/input.c (update_input_window): Draw a cheap-o cursor
diff --git a/NEWS b/NEWS
index 740f4ea..efa3d31 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,16 @@
ratpoison NEWS --- history of user-visible changes. -*- outline -*-
* Changes since 1.0.0
+** Command defbartimeout renamed to msgwait
+This was done to better mirror screen commands.
+
+** Command generate renamed to meta
+This was done to better mirror screen commands.
+
+** Comand maximize renamed to redisplay
+This was done to better mirror screen commands. It is no longer bound
+to C-t m it is now bound to C-t l.
+
** Cursor in the input window
There is now a cheap cursor to help you remember where you are.
diff --git a/src/actions.c b/src/actions.c
index a38c9e7..c963a1a 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -42,11 +42,11 @@ static user_command user_commands[] =
{"escape", cmd_escape, arg_STRING},
{"exec", cmd_exec, arg_STRING},
{"focus", cmd_next_frame, arg_VOID},
- {"generate", cmd_generate, arg_STRING}, /* rename to stuff */
+ {"meta", cmd_meta, arg_STRING},
{"help", cmd_help, arg_VOID},
{"hsplit", cmd_h_split, arg_VOID},
{"kill", cmd_kill, arg_VOID},
- {"maximize", cmd_maximize, arg_VOID},
+ {"redisplay", cmd_redisplay, arg_VOID},
{"newwm", cmd_newwm, arg_STRING},
{"next", cmd_next, arg_VOID},
{"number", cmd_number, arg_STRING},
@@ -65,10 +65,11 @@ static user_command user_commands[] =
{"version", cmd_version, arg_VOID},
{"vsplit", cmd_v_split, arg_VOID},
{"windows", cmd_windows, arg_VOID},
+ {"setenv", cmd_setenv, arg_STRING},
/* Commands to set default behavior. */
{"defbarloc", cmd_defbarloc, arg_STRING},
- {"defbartimeout", cmd_defbartimeout, arg_STRING},
+ {"msgwait", cmd_msgwait, arg_STRING},
{"defborder", cmd_defborder, arg_STRING},
{"deffont", cmd_deffont, arg_STRING},
{"definputwidth", cmd_definputwidth, arg_STRING},
@@ -90,22 +91,11 @@ static user_command user_commands[] =
implemented. See the screen documentation for what should be
emulated with these commands */
#if 0
- {"hardcopy", cmd_unimplemented, arg_VOID},
{"lastmsg", cmd_unimplemented, arg_VOID},
{"license", cmd_unimplemented, arg_VOID},
- {"lockscreen", cmd_unimplemented, arg_VOID},
- {"meta", cmd_unimplemented, arg_VOID},
{"msgminwait", cmd_unimplemented, arg_VOID},
- {"msgwait", cmd_unimplemented, arg_VOID},
{"nethack", cmd_unimplemented, arg_VOID},
- {"redisplay", cmd_unimplemented, arg_VOID},
- {"screen", cmd_unimplemented, arg_VOID},
- {"setenv", cmd_unimplemented, arg_VOID},
- {"shell", cmd_unimplemented, arg_VOID},
- {"shelltitle", cmd_unimplemented, arg_VOID},
{"sleep", cmd_unimplemented, arg_VOID},
- {"sorendition", cmd_unimplemented, arg_VOID},
- {"startup_message", cmd_unimplemented, arg_VOID},
{"stuff", cmd_unimplemented, arg_VOID},
#endif
{0, 0, 0} };
@@ -208,7 +198,7 @@ initialize_default_keybindings (void)
prefix_key.state = MODIFIER_PREFIX;
add_keybinding (prefix_key.sym, prefix_key.state, "other");
- add_keybinding (prefix_key.sym, 0, "generate");
+ add_keybinding (prefix_key.sym, 0, "meta");
add_keybinding (XK_g, ControlMask, "abort");
add_keybinding (XK_0, 0, "select 0");
add_keybinding (XK_1, 0, "select 1");
@@ -238,8 +228,8 @@ initialize_default_keybindings (void)
add_keybinding (XK_exclam, ControlMask, "colon exec " TERM_PROG " -e ");
add_keybinding (XK_k, 0, "delete");
add_keybinding (XK_k, ControlMask, "delete");
- add_keybinding (XK_m, 0, "maximize");
- add_keybinding (XK_m, ControlMask, "maximize");
+ add_keybinding (XK_l, 0, "redisplay");
+ add_keybinding (XK_l, ControlMask, "redisplay");
add_keybinding (XK_n, 0, "next");
add_keybinding (XK_n, ControlMask, "next");
add_keybinding (XK_p, 0, "prev");
@@ -468,7 +458,7 @@ cmd_source (int interactive, void *data)
}
char *
-cmd_generate (int interactive, void *data)
+cmd_meta (int interactive, void *data)
{
XEvent ev1, ev;
ev = rp_current_event;
@@ -1038,12 +1028,11 @@ cmd_abort (int interactive, void *data)
return NULL;
}
-/* Maximize the current window. */
+/* Redisplay the current window by sending 2 resize events. */
char *
-cmd_maximize (int interactive, void *data)
+cmd_redisplay (int interactive, void *data)
{
force_maximize (current_window());
-
return NULL;
}
@@ -1067,9 +1056,9 @@ cmd_escape (int interactive, void *data)
action->state = key->state;
}
- /* Update the "generate" keybinding */
+ /* Update the "meta" keybinding */
action = find_keybinding(prefix_key.sym, 0);
- if (action != NULL && !strcmp (action->data, "generate"))
+ if (action != NULL && !strcmp (action->data, "meta"))
{
action->key = key->sym;
action->state = 0;
@@ -1455,20 +1444,20 @@ cmd_defmaxsizepos (int interactive, void *data)
}
char *
-cmd_defbartimeout (int interactive, void *data)
+cmd_msgwait (int interactive, void *data)
{
int tmp;
if (data == NULL
|| sscanf (data, "%d", &tmp) < 1)
{
- message (" defbartimeout: One argument required ");
+ message (" msgwait: One argument required ");
}
if (tmp >= 0)
defaults.bar_timeout = tmp;
else
- message (" defbartimeout: Bad argument ");
+ message (" msgwait: Bad argument ");
return NULL;
}
@@ -1776,3 +1765,32 @@ cmd_defbgcolor (int interactive, void *data)
return NULL;
}
+
+char *
+cmd_setenv (int interactive, void *data)
+{
+ char *var, *string;
+
+ if (data == NULL)
+ {
+ message (" setenv: Two arguments required ");
+ return NULL;
+ }
+
+ /* Get the 2 arguments. */
+ var = xmalloc (strlen (data) + 1);
+ string = xmalloc (strlen (data) + 1);
+ if (sscanf (data, "%s %s", var, string) < 2)
+ {
+ message (" setenv: Two arguments required ");
+ free (var);
+ free (string);
+ return NULL;
+ }
+
+ setenv (var, string, 1);
+
+ free (var);
+ free (string);
+ return NULL;
+}
diff --git a/src/actions.h b/src/actions.h
index 2b85370..39639a2 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -41,7 +41,7 @@ void spawn(void *data);
char * command (int interactive, char *data);
char * cmd_newwm(int interactive, void *which);
-char * cmd_generate (int interactive, void *data);
+char * cmd_meta (int interactive, void *data);
char * cmd_abort (int interactive, void *data);
char * cmd_exec (int interactive, void *data);
char * cmd_colon (int interactive, void *data);
@@ -61,7 +61,7 @@ char * cmd_version (int interactive, void *data);
char * cmd_unimplemented (int interactive, void *data);
char * cmd_bind (int interactive, void* data);
char * cmd_source (int interactive, void* data);
-char * cmd_maximize (int interactive, void *data);
+char * cmd_redisplay (int interactive, void *data);
char * cmd_escape (int interactive, void *data);
char * cmd_echo (int interactive, void *data);
char * cmd_h_split (int interactive, void *data);
@@ -79,7 +79,7 @@ char * cmd_pos (int interactive, void *data);
char * cmd_defwinpos (int interactive, void *data);
char * cmd_deftranspos (int interactive, void *data);
char * cmd_defmaxsizepos (int interactive, void *data);
-char * cmd_defbartimeout (int interactive, void *data);
+char * cmd_msgwait (int interactive, void *data);
char * cmd_defbarloc (int interactive, void *data);
char * cmd_deffont (int interactive, void *data);
char * cmd_defpadding (int interactive, void *data);
@@ -90,6 +90,7 @@ char * cmd_defwinfmt (int interactive, void *data);
char * cmd_defwinname (int interactive, void *data);
char * cmd_deffgcolor (int interactive, void *data);
char * cmd_defbgcolor (int interactive, void *data);
+char * cmd_setenv (int interactive, void *data);
/* void cmd_xterm (void *data); */