summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--NEWS12
-rw-r--r--src/actions.c20
-rw-r--r--src/conf.h4
-rw-r--r--src/input.c8
5 files changed, 58 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index cc7aa92..b66221e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-08-24 Shawn <sabetts@hotdog>
+
+ * src/input.c (get_more_input): detect and handle a user abort key
+ sequence.
+
+ * src/conf.h (INPUT_ABORT_KEY): new define
+ (INPUT_ABORT_MODIFIER): likewise
+
+ * src/actions.c (cmd_select): handle a user abort.
+ (cmd_rename): likewise
+ (cmd_colon): likewise
+ (cmd_exec): likewise
+ (cmd_newwm): likewise
+
2001-08-23 Shawn <sabetts@hotlunch>
* src/manage.c (maximize_normal): In the new height on windows
diff --git a/NEWS b/NEWS
index e702769..8797010 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,18 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*-
* Changes since 0.1.1
+** Transient window handling has changed
+Transient windows now map ontop of the current window.
+
+** new command 'rudeness'
+This command allows you to fine tune what windows rp will map
+when. For instance you can ask rp not to map new windows. Instead it
+will notify you with a message: "New window #1 (emacs)".
+
+** user abort key sequence
+When typing input, hit C-g (customizable in conf.h) to abort the
+input.
+
** new key syntax
keys are now specified with C-, M-, A-, H-, S- which stand for the
control, meta, alt, hyper, and super modifiers. ^ does not denote
diff --git a/src/actions.c b/src/actions.c
index b88ce85..3cb5e9a 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -549,6 +549,10 @@ cmd_select (int interactive, void *data)
else
str = strdup ((char *) data);
+ /* User aborted. */
+ if (str == NULL)
+ return NULL;
+
/* Only search if the string contains something to search for. */
if (strlen (str) > 0)
{
@@ -597,6 +601,10 @@ cmd_rename (int interactive, void *data)
else
winname = strdup ((char *) data);
+ /* User aborted. */
+ if (winname == NULL)
+ return NULL;
+
if (*winname)
{
free (current_window()->name);
@@ -717,6 +725,10 @@ cmd_colon (int interactive, void *data)
else
input = get_more_input (MESSAGE_PROMPT_COMMAND, data);
+ /* User aborted. */
+ if (input == NULL)
+ return NULL;
+
result = command (1, input);
/* Gobble the result. */
@@ -738,6 +750,10 @@ cmd_exec (int interactive, void *data)
else
cmd = strdup ((char *) data);
+ /* User aborted. */
+ if (cmd == NULL)
+ return NULL;
+
spawn (cmd);
free (cmd);
@@ -782,6 +798,10 @@ cmd_newwm(int interactive, void *data)
else
prog = strdup ((char *) data);
+ /* User aborted. */
+ if (prog == NULL)
+ return NULL;
+
PRINT_DEBUG ("Switching to %s\n", prog);
putenv(DisplayString(dpy));
diff --git a/src/conf.h b/src/conf.h
index 05727a8..3289d50 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -28,6 +28,10 @@
#define KEY_PREFIX XK_t
#define MODIFIER_PREFIX ControlMask
+/* This is the abort key when typing input. */
+#define INPUT_ABORT_KEY XK_g
+#define INPUT_ABORT_MODIFIER ControlMask
+
/* After hitting the prefix key ratpoison will change the mouse cursor
to a square to indicate that it is waiting for a second
keystroke. If do not wish this functionality, comment out the
diff --git a/src/input.c b/src/input.c
index 60f4624..a0523eb 100644
--- a/src/input.c
+++ b/src/input.c
@@ -323,6 +323,14 @@ get_more_input (char *prompt, char *preinput)
if (cur_len > 0) cur_len--;
update_input_window(s, prompt, str, cur_len);
}
+ else if (ch == INPUT_ABORT_KEY && modifier == INPUT_ABORT_MODIFIER)
+ {
+ /* User aborted. */
+ free (str);
+ XSetInputFocus (dpy, fwin, RevertToPointerRoot, CurrentTime);
+ XUnmapWindow (dpy, s->input_window);
+ return NULL;
+ }
else
{
if (cur_len + nbytes > allocated_len - 1)