aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feature-tests/sig_unbind.pl58
-rw-r--r--patches/fix-signal-remove-coderef.patch22
-rw-r--r--quit-notify/notifyquit.pl2
-rw-r--r--vim-mode/vim_mode.pl11
4 files changed, 91 insertions, 2 deletions
diff --git a/feature-tests/sig_unbind.pl b/feature-tests/sig_unbind.pl
new file mode 100644
index 0000000..3123182
--- /dev/null
+++ b/feature-tests/sig_unbind.pl
@@ -0,0 +1,58 @@
+use strict;
+use warnings;
+
+
+use Irssi (@Irssi::EXPORT_OK);
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => 'shabble',
+ contact => 'shabble+irssi@metavore.org',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+command_bind("dosig_r",
+ sub {
+ my $ref = \&cmd_oink;
+ _print("binding oink to $ref");
+ signal_add("command oink", $ref);
+ });
+
+command_bind("undosig_r",
+ sub {
+ my $ref = \&cmd_oink;
+
+ _print("unbinding oink from $ref");
+
+ signal_remove("command oink", $ref);
+ });
+
+command_bind("dosig_s",
+ sub {
+ signal_add("command oink", 'cmd_oink');
+ });
+
+command_bind("undosig_s",
+ sub {
+ signal_remove("command oink", 'cmd_oink');
+ });
+
+sub cmd_oink {
+ Irssi::active_win()->print("Oink:");
+}
+
+sub _print {
+ Irssi::active_win()->print($_[0]);
+}
+
+command("dosig_r");
+command("oink");
+command("undosig_r");
+command("oink");
diff --git a/patches/fix-signal-remove-coderef.patch b/patches/fix-signal-remove-coderef.patch
new file mode 100644
index 0000000..e2ecd19
--- /dev/null
+++ b/patches/fix-signal-remove-coderef.patch
@@ -0,0 +1,22 @@
+From f1f66db22e732ca3e5d920c64c8b904e2fb92762 Mon Sep 17 00:00:00 2001
+From: Tom Feist <shabble@metavore.org>
+Date: Fri, 8 Apr 2011 20:28:41 +0100
+Subject: [PATCH] bugfix: allow Irssi::signal_remove to work properly with coderefs
+
+
+diff --git a/src/perl/perl-signals.c b/src/perl/perl-signals.c
+index a455cfd..1652d09 100644
+--- a/src/perl/perl-signals.c
++++ b/src/perl/perl-signals.c
+@@ -434,8 +434,9 @@ static void perl_signal_remove_list_one(GSList **siglist, PERL_SIGNAL_REC *rec)
+ }
+
+ #define sv_func_cmp(f1, f2) \
+- (f1 == f2 || (SvPOK(f1) && SvPOK(f2) && \
+- strcmp((char *) SvPV_nolen(f1), (char *) SvPV_nolen(f2)) == 0))
++ ((SvROK(f1) && SvROK(f2) && SvRV(f1) == SvRV(f2)) || \
++ (SvPOK(f1) && SvPOK(f2) && \
++ strcmp((char *) SvPV_nolen(f1), (char *) SvPV_nolen(f2)) == 0))
+
+ static void perl_signal_remove_list(GSList **list, SV *func)
+ {
diff --git a/quit-notify/notifyquit.pl b/quit-notify/notifyquit.pl
index 501ce88..6201c73 100644
--- a/quit-notify/notifyquit.pl
+++ b/quit-notify/notifyquit.pl
@@ -91,7 +91,7 @@ sub sig_send_text {
if ($target_nick) {
if (not $witem->nick_find($target_nick)) {
- return if $target_nick =~ m/^https?/i;
+ return if $target_nick =~ m/^(?:https?)|ftp/i;
if ($permit_pending) {
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 906905f..b279790 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -2078,6 +2078,11 @@ sub _parse_mapping_bracket {
sub _parse_mapping_reverse {
my ($string) = @_;
+ if (not defined $string) {
+ _warn("Unable to reverse-map command: " . join('', @ex_buf));
+ return;
+ }
+
my $escaped_leader = quotemeta($settings->{map_leader}->{value});
$string =~ s/$escaped_leader/<Leader>/g;
@@ -2808,7 +2813,11 @@ sub handle_command_ex {
print "Tab pressed" if DEBUG;
print "Ex buf contains: " . join('', @ex_buf) if DEBUG;
@tab_candidates = _tab_complete(join('', @ex_buf), [keys %$commands_ex]);
-
+ _debug("Candidates: " . join(", ", @tab_candidates));
+ if (@tab_candidates == 1) {
+ @ex_buf = ( split('', $tab_candidates[0]), ' ');
+ _set_prompt(':' . join '', @ex_buf);
+ }
# Ignore control characters for now.
} elsif ($key > 0 && $key < 32) {
# TODO: use them later, e.g. completion