dot/ipython-key-bindings.py: Don't leak names into the toplevel environment.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 4 May 2020 00:00:51 +0000 (01:00 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 4 May 2020 00:15:29 +0000 (01:15 +0100)
commit8654d79933fb72898ecf4fd43dfeb624a574ddbd
treee5acfb7cc9d2aaaca8939ba832506df75ebd5995
parentbe6f67499ecde598ec78e231fc64a0710a45633e
dot/ipython-key-bindings.py: Don't leak names into the toplevel environment.

It seems that this file, unlike the `ipython-config.py', is evaluated in
the same toplevel environment as is used for the interactive session.  I
initially tried to do this by deleting all the names after I'd finished
using them, but the `inhibit_history_search' function is looked up by
name from the `prev_line' and `next_line' bindings, so that doesn't
work.  Instead, lambda-bind everything by wrapping a function around the
whole lot; the evaluate the function to make everything happen, and
delete the function name, leaving the bindings functions in its orphaned
environment.
dot/ipython-key-bindings.py