Irssi core bugs

Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 85 Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 90
  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Feature Request
  • Category core
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Normal
  • Reported Version irssi 0.8.15
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: Irssi core bugs
Opened by Tom (shabble) - 2011-04-07

FS#797 - Patch adding scripting interface for /BIND-like keybindings

The attached patch provides a scripting interface to the Irssi keybindings.

It provides the following functions:

Irssi::bindings()

This returns a hashref of all current bindings in the form
{ 'key' => [ "function", "data" ], ... }.

Function is either an internal irssi function (all those shown by /bind -list),
or a string matching /multi|key|command/.

"multi" indicates that data will contain multiple internal commands, separated
by semicolons.

"key" indicates that data will contain the name of a key, to allow indirect
bindings.

"command" indicates that data will contain an Irssi /command (but stripped of
its leading $cmdchar)


Irssi::binding_find($key)

This returns an arrayref of the form [ "function", "data" ], where function
and data have the same meaning as in the above description.

$key is the search string in standard irssi form ("meta-x", "^Q", etc).

If there is no matching binding for the provided key, the arrayref is empty.
(TODO: maybe should return undef or "false" instead?)

Irssi::binding_add($key, $function, $data)

This adds a new binding, or overwrites an existing one, again using the same
meaning of the variables as described above.

Irssi::binding_remove($key)

This removes a binding specified by $key (equivalent to /bind -delete <key>).

Note: This is my first proper attempt at an irssi feature and patch, and may
require some reworking or cleanup before it is ready to be applied.

Any suggestions on how to improve it are welcomed.

It should apply cleanly against the current trunk of git.irssi.org/git.

This task does not depend on any other tasks.

Tom (shabble)
Thursday, 07 April 2011, 10:47 GMT
I forgot to mention, the practical application of this to begin with would be to clean up some of the more horrible bits of adv_windowlist.pl, which
has to hook 'gui print text' and parse the output of /bind in order to determine which windows have keys bound to switch_window <X>.

Loading...