From f90ee8e9dfcb3ab286c5202e96a0715429f0e4e7 Mon Sep 17 00:00:00 2001 From: sabetts Date: Mon, 13 Dec 2004 01:04:15 +0000 Subject: * src/sbuf.c (sbuf_concat): call sbuf_nconcat. move bulk of body to sbuf_nconcat. (sbuf_nconcat): new function * src/globals.c (init_globals): new function * src/main.c (main): call init_globals. * src/globals.c: include unistd.h. (x_export_selection): new function (set_nselection): likewise (set_selection): call x_export_selection (get_cut_buffer): new function (get_primary_selection): likewise (get_selection): likewise * src/editor.c (editor_kill_word): add the deleted text to the X11 selection (editor_backward_kill_word): likewise (editor_kill_line): likewise (backward_kill_line): new fuction (editor_backward_kill_line): add the deleted text to the X11 selection. call backward_kill_line. (paste_cut_buffer): remove function (paste_primary_selection): likewise (editor_paste_selection): call get_selection to get the X11 selection. (editor_complete): call backward_kill_line instead of editor_backward_kill_line. * src/ratpoison.h: Include string.h. Include X11/XAtom.h. * src/globals.c (selection): new global (set_selection): new function * src/events.c: include X11/Xmd.h (selection_request): new function (selection_clear): new function (delegate_event): call selection_request and selection_clear for SelectionRequest and SelectionClear events. * src/actions.c (user_commands): remove duplicate focusprev entry. Add putsel. Add getsel. (cmd_putsel): new function (cmd_getsel): new function * contrib/genrpbindings: add a missing paren to the elisp bindings. --- src/actions.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 92e16c4..acda13e 100644 --- a/src/actions.c +++ b/src/actions.c @@ -125,14 +125,15 @@ static user_command user_commands[] = {"cprev", cmd_cprev, arg_VOID}, {"dedicate", cmd_dedicate, arg_VOID}, {"describekey", cmd_describekey, arg_STRING}, - {"focusprev", cmd_prev_frame, arg_VOID}, {"inext", cmd_inext, arg_VOID}, {"iother", cmd_iother, arg_VOID}, {"iprev", cmd_iprev, arg_VOID}, - {"prompt", cmd_prompt, arg_STRING}, + {"prompt", cmd_prompt, arg_STRING}, {"sdump", cmd_sdump, arg_VOID}, {"sfdump", cmd_sfdump, arg_VOID}, {"undo", cmd_undo, arg_STRING}, + {"putsel", cmd_putsel, arg_STRING}, + {"getsel", cmd_getsel, arg_STRING}, /*@end (tag required for genrpbindings) */ /* Commands to help debug ratpoison. */ @@ -4973,3 +4974,21 @@ cmd_dedicate (int interactive, char *data) return NULL; } +char * +cmd_putsel (int interactive, char *data) +{ + if (data == NULL) + { + message ("putsel: one argument required"); + return NULL; + } + + set_selection(data); + return NULL; +} + +char * +cmd_getsel (int interactive, char *data) +{ + return get_selection(); +} -- cgit v1.2.3