Skip to content

Commit

Permalink
mystery of 'rlookup' solved
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Jul 26, 2018
1 parent 54103f4 commit b416551
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 21 additions & 1 deletion docs/include-cmd-scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,27 @@
method.rlookup
method.rlookup.clear

**TODO**
.. code-block:: ini
method.rlookup = ‹key› ≫ list of strings
method.rlookup.clear = ‹key› ≫ 0
``method.rlookup`` returns a list of multi-method names
that have a reverse lookup entry for the given key.
``method.rlookup.clear`` erases all those entries registered for ``‹key›``,
and also the reverse-lookup list for that key.

So if you added something under the same key to several events,
you can find them again easily and also remove them in one go.
Internally, this is used to clear old event handlers when setting
new ones with :term:`view.filter_on`.

.. rubric:: Example

.. code-block:: console
$ rtxmlrpc --repr method.rlookup '' \!view.main
['event.download.finished', 'event.download.inserted_new']
method.redirect
Expand Down
3 changes: 2 additions & 1 deletion docs/scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ multi (subtypes: static, private, const, rlookup)
Note that many internal entries in multi commands used by the system are prefixed
with either ``!`` or ``~``, to push them to the front or end of the processing order.

**TODO** rlookup?!
The ``rlookup`` flag enables a reverse index from method keys to method names.
See :term:`method.rlookup` for more details on that.

.. seealso::

Expand Down

0 comments on commit b416551

Please sign in to comment.