Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL keybindings cannot be changed after #265 fix #19718

Closed
KristofferC opened this issue Dec 25, 2016 · 7 comments
Closed

REPL keybindings cannot be changed after #265 fix #19718

KristofferC opened this issue Dec 25, 2016 · 7 comments
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Milestone

Comments

@KristofferC
Copy link
Member

KristofferC commented Dec 25, 2016

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 #19697)

@KristofferC KristofferC added docs This change adds or pertains to documentation REPL Julia's REPL (Read Eval Print Loop) labels Dec 25, 2016
@KristofferC KristofferC changed the title Docs for changing REPL keywords in manual now faulty. Docs for changing REPL keybindings are incorrect. Dec 25, 2016
@Shade5
Copy link
Contributor

Shade5 commented Dec 27, 2016

Can I work on this?

@yuyichao yuyichao removed the docs This change adds or pertains to documentation label Dec 27, 2016
@yuyichao
Copy link
Contributor

yuyichao commented Dec 27, 2016

This is not a doc issue.

@tkelman
Copy link
Contributor

tkelman commented Dec 27, 2016

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

@yuyichao
Copy link
Contributor

Because it's a REPL bug.

@KristofferC KristofferC changed the title Docs for changing REPL keybindings are incorrect. REPL keybindings cannot be changed after #265 fix Dec 27, 2016
@KristofferC KristofferC added the bug Indicates an unexpected problem or unintended behavior label Dec 27, 2016
@KristofferC KristofferC added this to the 0.6.0 milestone Dec 28, 2016
@tkelman tkelman added the regression Regression in behavior compared to a previous version label Dec 29, 2016
@vtjnash
Copy link
Member

vtjnash commented Dec 29, 2016

https://discourse.julialang.org/t/proposal-for-a-first-class-dispatch-wrapper/1127 would help make this not-an-issue.

@luchr
Copy link

luchr commented Jan 4, 2017

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

@KristofferC
Copy link
Member Author

Fixed by #19924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

6 participants