Julia: REPL keybindings cannot be changed after #265 fix

Created on 25 Dec 2016  路  7Comments  路  Source: JuliaLang/julia

Running the example at: http://docs.julialang.org/en/latest/manual/interacting-with-julia.html#Customizing-keybindings-1 now gives:

julia> WARNING: Caught an exception in the keymap:
ERROR: MethodError: no method matching (::##1#3)(::Base.LineEdit.MIState, ::Base.REPL.LineEditREPL, ::String)
The applicable method may be too new: running in world age 20393, while current world is 20396.
Closest candidates are:
  #1(::Any, ::Any...) at /home/kristoffer/.juliarc.jl:18 (method too new to be called from this world context.)

It should probably be updated to show how to do it in a post #265 world. cc @vtjnash

(This is after applying https://github.com/JuliaLang/julia/pull/19697)

REPL bug regression

All 7 comments

Can I work on this?

This is not a doc issue.

Why not? It's the docs that are incorrect here.

Because it's a REPL bug.

An ugly workaround?

diff --git a/base/LineEdit.jl b/base/LineEdit.jl
index 2749222..dfc237e 100644
--- a/base/LineEdit.jl
+++ b/base/LineEdit.jl
@@ -734,7 +734,7 @@ end
 keymap_fcn(f::Void, c) = (s, p) -> return :ok
 function keymap_fcn(f::Function, c)
     return function (s, p)
-        r = f(s, p, c)
+        r = eval(Expr(:call,f,s, p, c))
         if isa(r, Symbol)
             return r
         else

Fixed by #19924

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanKarpinski picture StefanKarpinski  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

tkoolen picture tkoolen  路  3Comments

yurivish picture yurivish  路  3Comments

musm picture musm  路  3Comments