-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: a7cb503cffd6b11e6e1e1774be488ba40eeb9a9b: path_to: revision_to:
commit a7cb503cffd6b11e6e1e1774be488ba40eeb9a9b Author: Marc Lehmann <schmorp@schmorp.de> Date: Sat Apr 26 18:53:51 2014 +0000 *** empty log message *** diff --git a/src/hookinc.h b/src/hookinc.h
--- a/src/hookinc.h +++ b/src/hookinc.h @@ -24,8 +24,9 @@ def (REFRESH_BEGIN) def (REFRESH_END) - def (USER_COMMAND) def (REGISTER_COMMAND) + def (KEYBOARD_DISPATCH) + def (USER_COMMAND) def (ROOT_EVENT) def (X_EVENT) diff --git a/src/keyboard.C b/src/keyboard.C
--- a/src/keyboard.C +++ b/src/keyboard.C @@ -63,17 +63,6 @@ * Ni(the size of group i) = hash_bucket_size[Ii]. */ -static void -output_string (rxvt_term *term, const char *str) -{ - if (strncmp (str, "command:", 8) == 0) - term->cmdbuf_append (str + 8, strlen (str) - 8); - else if (strncmp (str, "perl:", 5) == 0) - HOOK_INVOKE((term, HOOK_USER_COMMAND, DT_STR, str + 5, DT_END)); - else - term->tt_write (str, strlen (str)); -} - // return: priority_of_a - priority_of_b static int compare_priority (keysym_t *a, keysym_t *b) @@ -150,7 +139,17 @@ keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state, // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.) free (ws); - output_string (term, str); + if (char *colon = strchr (str, ':')) + { + if (strncmp (str, "command:", 8) == 0) + term->cmdbuf_append (str + 8, strlen (str) - 8); + else if (strncmp (str, "perl:", 8) == 0) + HOOK_INVOKE ((term, HOOK_USER_COMMAND, DT_STR, colon + 1, DT_END)); + else if (HOOK_INVOKE ((term, HOOK_KEYBOARD_DISPATCH, DT_STR_LEN, str, colon - str, DT_STR, colon + 1, DT_END))) + /* done */; + else + term->tt_write (str, strlen (str)); + } free (str); diff --git a/src/urxvt.pm b/src/urxvt.pm
--- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -283,27 +283,27 @@ code is run after this hook, and takes precedence. Called just after the screen gets redrawn. See C<on_refresh_begin>. -=item on_user_command $term, $string +=item on_user_command $term, $string *DEPRECATED* Called whenever a user-configured event is being activated (e.g. via a C<perl:string> action bound to a key, see description of the B<keysym> resource in the urxvt(1) manpage). -The event is simply the action string. This interface is assumed to change -slightly in the future. +The event is simply the action string. This interface is going away in +preference to the C<< ->register_keysym_action >> method. =item on_register_command $term, $keysym, $modifiermask, $string Called after parsing a keysym resource but before registering the -associated binding. If this hook returns TRUE the binding is not -registered. It can be used to modify a binding by calling +associated binding. If this hook returns a true value the binding +is not registered. It can be used to modify a binding by calling C<register_command>. =item on_resize_all_windows $term, $new_width, $new_height Called just after the new window size has been calculated, but before windows are actually being resized or hints are being set. If this hook -returns TRUE, setting of the window hints is being skipped. +returns a true value, setting of the window hints is being skipped. =item on_x_event $term, $event @@ -829,8 +829,11 @@ sub urxvt::destroy_hook(&) { =item $self->enable ($hook_name => $cb[, $hook_name => $cb..]) Dynamically enable the given hooks (named without the C<on_> prefix) for -this extension, replacing any previous hook. This is useful when you want -to overwrite time-critical hooks only temporarily. +this extension, replacing any hook previously installed via C<enable> in +this extension. + +This is useful when you want to overwrite time-critical hooks only +temporarily. To install additional callbacks for the same hook, you can use the C<on> method of the C<urxvt::term> class.
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 11:33:18 2024