summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-12-13 02:59:25 +0000
committersabetts <sabetts>2004-12-13 02:59:25 +0000
commiteac6f3d217e4490f9ec1b6610d6d7aed2200ef3c (patch)
treefc2f1f0b87f10e86004e35cdcbc7c7a30c0c92aa
parentf90ee8e9dfcb3ab286c5202e96a0715429f0e4e7 (diff)
downloadratpoison-eac6f3d217e4490f9ec1b6610d6d7aed2200ef3c.zip
(cmd_appendsel): new function
(user_commands): new command
-rw-r--r--ChangeLog5
-rw-r--r--src/actions.c27
-rw-r--r--src/actions.h1
3 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5802c41..4f8bdc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-12 Shawn Betts <katia_dilkina@verizon.net>
+
+ * src/actions.c (cmd_appendsel): new function
+ (user_commands): new command
+
2004-12-12 Shawn Betts <sabetts@vcn.bc.ca>
* src/sbuf.c (sbuf_concat): call sbuf_nconcat. move bulk of body
diff --git a/src/actions.c b/src/actions.c
index acda13e..e9b6704 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -134,6 +134,7 @@ static user_command user_commands[] =
{"undo", cmd_undo, arg_STRING},
{"putsel", cmd_putsel, arg_STRING},
{"getsel", cmd_getsel, arg_STRING},
+ {"appendsel", cmd_appendsel, arg_STRING},
/*@end (tag required for genrpbindings) */
/* Commands to help debug ratpoison. */
@@ -4992,3 +4993,29 @@ cmd_getsel (int interactive, char *data)
{
return get_selection();
}
+
+char *
+cmd_appendsel (int interactive, char *data)
+{
+ char *sel;
+
+ if (data == NULL)
+ {
+ message ("appendsel: One argument required");
+ return NULL;
+ }
+
+ sel = get_selection();
+ if (sel)
+ {
+ char *new_sel;
+ new_sel = xsprintf ("%s%s", sel, data);
+ free (sel);
+ set_selection (new_sel);
+ free (new_sel);
+ }
+ else
+ set_selection (data);
+
+ return NULL;
+}
diff --git a/src/actions.h b/src/actions.h
index e046aa9..73ce89b 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -143,6 +143,7 @@ char *cmd_sfdump (int interactively, char *data);
char *cmd_undo (int interactive, char *data);
char *cmd_putsel (int interactive, char *data);
char *cmd_getsel (int interactive, char *data);
+char *cmd_appendsel (int interactive, char *data);
void pop_frame_undo (rp_frame_undo *u);
rp_keymap *find_keymap (char *name);