diff --git a/base/LineEdit.jl b/base/LineEdit.jl index 10daf96fde191..8d7ae8e78c0af 100644 --- a/base/LineEdit.jl +++ b/base/LineEdit.jl @@ -153,8 +153,9 @@ function complete_line(s::PromptState) end end -clear_input_area(s) = (clear_input_area(s.terminal, s.ias); s.ias = InputAreaState(0, 0)) -function clear_input_area(terminal, state::InputAreaState) +clear_input_area(terminal, s) = (_clear_input_area(terminal, s.ias); s.ias = InputAreaState(0, 0)) +clear_input_area(s) = clear_input_area(s.terminal,s) +function _clear_input_area(terminal, state::InputAreaState) # Go to the last line if state.curs_row < state.num_rows cmove_down(terminal, state.num_rows-state.curs_row) @@ -173,12 +174,13 @@ end prompt_string(s::PromptState) = s.p.prompt prompt_string(s::String) = s -refresh_multi_line(s::PromptState) = s.ias = refresh_multi_line(s.terminal, buffer(s), s.ias, s, indent = s.indent) +refresh_multi_line(termbuf::TerminalBuffer,s::PromptState) = s.ias = + refresh_multi_line(termbuf,terminal(s), buffer(s), s.ias, s, indent = s.indent) -function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; indent = 0) +function refresh_multi_line(termbuf::TerminalBuffer, terminal::TTYTerminal, buf, state::InputAreaState,prompt = ""; indent = 0) cols = width(terminal) - clear_input_area(terminal, state) + _clear_input_area(termbuf, state) curs_row = -1 # relative to prompt curs_col = -1 # absolute @@ -187,7 +189,7 @@ function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; in buf_pos = position(buf) line_pos = buf_pos # Write out the prompt string - write_prompt(terminal, prompt) + write_prompt(termbuf, prompt) prompt = prompt_string(prompt) seek(buf, 0) @@ -211,9 +213,11 @@ function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; in curs_row = div(plength+num_chars-1, cols) + 1 curs_pos = (plength+num_chars-1) % cols + 1 end - cur_row += div(plength+llength-1, cols) + # One -1 for the '\n' at the end of the line (since it doesn't take up a column) + # The other -1, since we want 10,20 for cols=10 to still not add a row (but we want 11,21 to) + cur_row += div(max(plength+(llength-1)-1,0), cols) line_pos -= slength - write(terminal, l) + write(termbuf, l) else # We expect to be line after the last valid output line (due to # the '\n' at the end of the previous line) @@ -224,22 +228,22 @@ function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; in curs_pos = (indent+num_chars-1) % cols + 1 end line_pos -= slength #'\n' gets an extra pos - cur_row += div(llength+indent-1, cols) - cmove_col(terminal, indent+1) - write(terminal, l) + cur_row += div(max(indent+(llength-1)-1,0), cols) + cmove_col(termbuf, indent+1) + write(termbuf, l) # There's an issue if the last character we wrote was at the very right end of the screen. In that case we need to # emit a new line and move the cursor there. if curs_pos == cols - write(terminal, "\n") - cmove_col(terminal, 1) + write(termbuf, "\n") + cmove_col(termbuf, 1) curs_row += 1 curs_pos = 0 cur_row += 1 end else cur_row += div(llength+indent-1, cols) - cmove_col(terminal, indent+1) - write(terminal, l) + cmove_col(termbuf, indent+1) + write(termbuf, l) end end end @@ -257,8 +261,8 @@ function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; in # Same issue as above. TODO: We should figure out # how to refactor this to avoid duplcating functionality. if curs_pos == cols - write(terminal, "\n") - cmove_col(terminal, 1) + write(termbuf, "\n") + cmove_col(termbuf, 1) curs_row += 1 curs_pos = 0 cur_row += 1 @@ -268,13 +272,11 @@ function refresh_multi_line(terminal, buf, state::InputAreaState,prompt = ""; in # The line first n = cur_row - curs_row if n > 0 - cmove_up(terminal, n) + cmove_up(termbuf, n) end #columns are 1 based - cmove_col(terminal, curs_pos+1) - - flush(terminal) + cmove_col(termbuf, curs_pos+1) # Updated cur_row,curs_row return InputAreaState(cur_row, curs_row) @@ -577,6 +579,7 @@ function history_prev(s, hist) if ok replace_line(s, l) move_input_start(s) + refresh_line(s) else beep(LineEdit.terminal(s)) end @@ -586,19 +589,20 @@ function history_next(s, hist) if ok replace_line(s, l) move_input_end(s) + refresh_line(s) else beep(LineEdit.terminal(s)) end end refresh_line(s) = refresh_multi_line(s) +refresh_line(s,termbuf) = refresh_multi_line(termbuf,s) default_completion_cb(::IOBuffer) = [] default_enter_cb(_) = true write_prompt(terminal, s::PromptState) = write_prompt(terminal, s, s.p.prompt) function write_prompt(terminal, s::PromptState,prompt) - @assert terminal == LineEdit.terminal(s) write(terminal, s.p.prompt_color) write(terminal, prompt) write(terminal, Base.text_colors[:normal]) @@ -866,7 +870,8 @@ function history_set_backward(s::SearchState, backward) s.backward = backward end -function refresh_multi_line(s::SearchState) +refresh_multi_line(termbuf::TerminalBuffer, term, s::Union(SearchState,PromptState)) = (@assert term == terminal(s); refresh_multi_line(termbuf,s)) +function refresh_multi_line(termbuf::TerminalBuffer, s::SearchState) buf = IOBuffer() write(buf, pointer(s.query_buffer.data), s.query_buffer.ptr-1) write(buf, "': ") @@ -876,7 +881,21 @@ function refresh_multi_line(s::SearchState) write(buf, readall(s.response_buffer)) buf.ptr = offset + ptr - 1 s.response_buffer.ptr = ptr - s.ias = refresh_multi_line(s.terminal, buf, s.ias, s.backward ? "(reverse-i-search)`" : "(i-search)`") + s.ias = refresh_multi_line(termbuf, s.terminal, buf, s.ias, s.backward ? "(reverse-i-search)`" : "(i-search)`") +end + +function refresh_multi_line(s::Union(SearchState,PromptState)) + refresh_multi_line(terminal(s),s) +end + +function refresh_multi_line(terminal::TTYTerminal, args...; kwargs...) + outbuf = IOBuffer() + termbuf = TerminalBuffer(outbuf) + ret = refresh_multi_line(termbuf, terminal, args...;kwargs...) + # Output the entire refresh at once + write(terminal,takebuf_array(outbuf)) + flush(terminal) + return ret end function reset_state(s::SearchState) @@ -986,13 +1005,13 @@ function setup_search_keymap(hp) # Ctrl-Right Arrow "\e[1;5C" => "\ef", # ^A - 1 => s->(accept_result(s, p); move_line_start(s)), + 1 => s->(accept_result(s, p); move_line_start(s); refresh_line(s)), # ^E - 5 => s->(accept_result(s, p); move_line_end(s)), + 5 => s->(accept_result(s, p); move_line_end(s); refresh_line(s)), "^Z" => :(return :suspend), # Try to catch all Home/End keys - "\e[H" => s->(accept_result(s, p); move_input_start(s)), - "\e[F" => s->(accept_result(s, p); move_input_end(s)), + "\e[H" => s->(accept_result(s, p); move_input_start(s); refresh_line(s)), + "\e[F" => s->(accept_result(s, p); move_input_end(s); refresh_line(s)), "*" => :(LineEdit.edit_insert(data.query_buffer, c1); LineEdit.update_display_buffer(s, data)) } p.keymap_func = @eval @LineEdit.keymap $([pkeymap, escape_defaults]) @@ -1010,8 +1029,8 @@ Base.isempty(s::PromptState) = s.input_buffer.size == 0 on_enter(s::PromptState) = s.p.on_enter(s) -move_input_start(s) = (seek(buffer(s), 0); refresh_line(s)) -move_input_end(s) = (seekend(buffer(s)); refresh_line(s)) +move_input_start(s) = (seek(buffer(s), 0)) +move_input_end(s) = (seekend(buffer(s))) function move_line_start(s) buf = buffer(s) curpos = position(buf) @@ -1021,7 +1040,6 @@ function move_line_start(s) else seek(buf, rsearch(buf.data, '\n', curpos-1)) end - refresh_line(s) end function move_line_end(s) buf = buffer(s) @@ -1039,11 +1057,11 @@ function move_line_end(s) return end seek(buf, pos-1) - refresh_line(s) end function commit_line(s) LineEdit.move_input_end(s) + LineEdit.refresh_line(s) println(LineEdit.terminal(s)) LineEdit.add_history(s) LineEdit.state(s, LineEdit.mode(s)).ias = @@ -1123,12 +1141,12 @@ const default_keymap = # ^Y 25 => edit_yank, # ^A - 1 => move_line_start, + 1 => :( LineEdit.move_line_start(s); LineEdit.refresh_line(s) ), # ^E - 5 => move_line_end, + 5 => :( LineEdit.move_line_end(s); LineEdit.refresh_line(s) ), # Try to catch all Home/End keys - "\e[H" => move_input_start, - "\e[F" => move_input_end, + "\e[H" => :(LineEdit.move_input_start(s); LineEdit.refresh_line(s)), + "\e[F" => :(LineEdit.move_input_end(s); LineEdit.refresh_line(s)), # ^L 12 => :(Terminals.clear(LineEdit.terminal(s)); LineEdit.refresh_line(s)), # ^W @@ -1184,21 +1202,21 @@ function history_keymap(hist) } end -function deactivate(p::Union(Prompt,HistoryPrompt), s::Union(SearchState,PromptState)) - clear_input_area(s) +function deactivate(p::Union(Prompt,HistoryPrompt), s::Union(SearchState,PromptState), termbuf) + clear_input_area(termbuf,s) s end -function activate(p::Union(Prompt,HistoryPrompt), s::Union(SearchState,PromptState)) +function activate(p::Union(Prompt,HistoryPrompt), s::Union(SearchState,PromptState), termbuf) s.ias = InputAreaState(0, 0) - refresh_line(s) + refresh_line(s,termbuf) end -function activate(p::Union(Prompt,HistoryPrompt), s::MIState) +function activate(p::Union(Prompt,HistoryPrompt), s::MIState, termbuf) @assert p == s.current_mode - activate(p, s.mode_state[s.current_mode]) + activate(p, s.mode_state[s.current_mode], termbuf) end -activate(m::ModalInterface, s::MIState) = activate(s.current_mode, s) +activate(m::ModalInterface, s::MIState, termbuf) = activate(s.current_mode, s, termbuf) function transition(s::MIState, mode) if mode == :abort @@ -1209,9 +1227,11 @@ function transition(s::MIState, mode) reset_state(s) return end - s.mode_state[s.current_mode] = deactivate(s.current_mode, s.mode_state[s.current_mode]) + termbuf = TerminalBuffer(IOBuffer()) + s.mode_state[s.current_mode] = deactivate(s.current_mode, s.mode_state[s.current_mode], termbuf) s.current_mode = mode - activate(mode, s.mode_state[mode]) + activate(mode, s.mode_state[mode], termbuf) + write(terminal(s),takebuf_array(termbuf.out_stream)) end function reset_state(s::PromptState) @@ -1283,7 +1303,7 @@ function prompt!(terminal, prompt, s = init_state(terminal, prompt)) enable_bracketed_paste(terminal) try start_reading(terminal) - activate(prompt, s) + activate(prompt, s, terminal) while true state = keymap(s, prompt)(s, keymap_data(s, prompt)) if state == :abort diff --git a/base/REPL.jl b/base/REPL.jl index dba45c5134c30..352e54a551fcf 100644 --- a/base/REPL.jl +++ b/base/REPL.jl @@ -130,7 +130,7 @@ function print_response(d::REPLDisplay, errio::IO, r::AbstractREPL, val::ANY, bt break catch err if bt !== nothing - println(errio,"SYSTEM: show(lasterr) caused an error") + println(errio, "SYSTEM: show(lasterr) caused an error") break end val = err @@ -167,15 +167,17 @@ type ShellCompletionProvider <: CompletionProvider r::LineEditREPL end +bytestring_beforecursor(buf::IOBuffer) = bytestring(pointer(buf.data), buf.ptr-1) + function complete_line(c::REPLCompletionProvider, s) - partial = bytestring(s.input_buffer.data[1:position(s.input_buffer)]) + partial = bytestring_beforecursor(s.input_buffer) ret, range, should_complete = completions(partial, endof(partial)) return ret, partial[range], should_complete end function complete_line(c::ShellCompletionProvider, s) # First parse everything up to the current position - partial = bytestring(s.input_buffer.data[1:position(s.input_buffer)]) + partial = bytestring_beforecursor(s.input_buffer) ret, range, should_complete = shell_completions(partial, endof(partial)) return ret, partial[range], should_complete end @@ -211,7 +213,7 @@ function hist_from_file(hp, file) hp end -function mode_idx(hist::REPLHistoryProvider,mode) +function mode_idx(hist::REPLHistoryProvider, mode) c::Uint8 = 0 for (k,v) in hist.mode_mapping if k == uint8('\0') @@ -227,7 +229,7 @@ end function add_history(hist::REPLHistoryProvider, s) # bytestring copies - str = bytestring(pointer(s.input_buffer.data), s.input_buffer.size) + str = bytestring(s.input_buffer) if isempty(strip(str)) || # Do not add empty strings to the history (length(hist.history) > 0 && str == hist.history[end]) # Do not add consecutive duplicate entries return @@ -278,6 +280,7 @@ function history_prev(s::LineEdit.MIState, hist::REPLHistoryProvider) if history_move(s, hist, hist.cur_idx-1) LineEdit.move_input_start(s) LineEdit.move_line_end(s) + LineEdit.refresh_line(s) else Terminals.beep(LineEdit.terminal(s)) end @@ -292,6 +295,7 @@ function history_next(s::LineEdit.MIState, hist::REPLHistoryProvider) end if history_move(s, hist, cur_idx+1) LineEdit.move_input_end(s) + LineEdit.refresh_line(s) else Terminals.beep(LineEdit.terminal(s)) end @@ -301,14 +305,14 @@ function history_move_prefix(s::LineEdit.MIState, hist::REPLHistoryProvider, backwards::Bool) buf = LineEdit.buffer(s) - n = buf.ptr - 1 - prefix = bytestring(buf.data[1:min(n,buf.size)]) + pos = position(buf) + prefix = bytestring_beforecursor(buf) allbuf = bytestring(buf) idxs = backwards ? ((hist.cur_idx-1):-1:1) : ((hist.cur_idx+1):length(hist.history)) for idx in idxs if beginswith(hist.history[idx], prefix) && hist.history[idx] != allbuf history_move(s, hist, idx) - seek(LineEdit.buffer(s), n) + seek(LineEdit.buffer(s), pos) LineEdit.refresh_line(s) return end @@ -326,7 +330,7 @@ function history_search(hist::REPLHistoryProvider, query_buffer::IOBuffer, respo qpos = position(query_buffer) qpos > 0 || return true - searchdata = bytestring(query_buffer.data[1:qpos]) + searchdata = bytestring_beforecursor(query_buffer) # Alright, first try to see if the current match still works a = position(response_buffer) + 1 @@ -379,7 +383,7 @@ function return_callback(repl, s) else repl.consecutive_returns = 0 end - ast = parse_input_line(bytestring(copy(s.input_buffer))) + ast = parse_input_line(bytestring(s.input_buffer)) if repl.consecutive_returns > 1 || !isa(ast, Expr) || (ast.head != :continue && ast.head != :incomplete) return true else @@ -391,7 +395,7 @@ function find_hist_file() filename = ".julia_history2" if isfile(filename) return filename - elseif haskey(ENV,"JULIA_HISTORY") + elseif haskey(ENV, "JULIA_HISTORY") return ENV["JULIA_HISTORY"] else return joinpath(homedir(), filename) diff --git a/base/Terminals.jl b/base/Terminals.jl index 265a4cb27471e..0b8353eefd0fa 100644 --- a/base/Terminals.jl +++ b/base/Terminals.jl @@ -3,6 +3,8 @@ module Terminals export TextTerminal, UnixTerminal, + TerminalBuffer, + TTYTerminal, cmove, cmove_col, cmove_down, @@ -100,7 +102,13 @@ disable_bracketed_paste(t::TextTerminal) = nothing ## UnixTerminal ## -type UnixTerminal <: TextTerminal +abstract UnixTerminal <: TextTerminal + +type TerminalBuffer <: UnixTerminal + out_stream::Base.IO +end + +type TTYTerminal <: UnixTerminal term_type::ASCIIString in_stream::Base.TTY out_stream::Base.TTY @@ -117,13 +125,13 @@ cmove_line_up(t::UnixTerminal, n) = (cmove_up(t, n); cmove_col(t, 0)) cmove_line_down(t::UnixTerminal, n) = (cmove_down(t, n); cmove_col(t, 0)) cmove_col(t::UnixTerminal, n) = write(t.out_stream, "$(CSI)$(n)G") -raw!(t::UnixTerminal, raw::Bool) = ccall((@windows ? :jl_tty_set_mode : :uv_tty_set_mode), +raw!(t::TTYTerminal, raw::Bool) = ccall((@windows ? :jl_tty_set_mode : :uv_tty_set_mode), Int32, (Ptr{Void},Int32), t.in_stream.handle, raw ? 1 : 0) != -1 enable_bracketed_paste(t::UnixTerminal) = write(t.out_stream, "$(CSI)?2004h") disable_bracketed_paste(t::UnixTerminal) = write(t.out_stream, "$(CSI)?2004l") -function size(t::UnixTerminal) +function size(t::TTYTerminal) s = Array(Int32, 2) Base.uv_error("size (TTY)", ccall((@windows ? :jl_tty_get_winsize : :uv_tty_get_winsize), Int32, (Ptr{Void}, Ptr{Int32}, Ptr{Int32}), @@ -147,7 +155,7 @@ read(t::UnixTerminal, ::Type{Uint8}) = read(t.in_stream, Uint8) start_reading(t::UnixTerminal) = start_reading(t.in_stream) stop_reading(t::UnixTerminal) = stop_reading(t.in_stream) -@unix_only hascolor(t::UnixTerminal) = (beginswith(t.term_type, "xterm") || success(`tput setaf 0`)) -@windows_only hascolor(t::UnixTerminal) = true +@unix_only hascolor(t::TTYTerminal) = (beginswith(t.term_type, "xterm") || success(`tput setaf 0`)) +@windows_only hascolor(t::TTYTerminal) = true end # module diff --git a/base/base.jl b/base/base.jl index b53d127179183..c5b6a55ef62c4 100644 --- a/base/base.jl +++ b/base/base.jl @@ -1,6 +1,8 @@ # important core definitions -using Core.Intrinsics +using Core: Intrinsics, arraylen, arrayref, arrayset, arraysize, + tuplelen, tupleref, convert_default, convert_tuple, kwcall, + typeassert, apply_type import Core.Array # to add methods diff --git a/base/boot.jl b/base/boot.jl index 15b11be373d54..8cffca0dda6b1 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -135,11 +135,12 @@ export Expr, GotoNode, LabelNode, LineNumberNode, QuoteNode, SymbolNode, TopNode, GetfieldNode, NewvarNode, # object model functions - apply, arraylen, arrayref, arrayset, arraysize, fieldtype, getfield, - setfield!, yieldto, throw, tuple, tuplelen, tupleref, is, ===, isdefined, - convert_default, convert_tuple, kwcall, + apply, fieldtype, getfield, setfield!, yieldto, throw, tuple, is, ===, isdefined, + # arraylen, arrayref, arrayset, arraysize, tuplelen, tupleref, convert_default, + # convert_tuple, kwcall, # type reflection - issubtype, typeassert, typeof, apply_type, isa, + issubtype, typeof, isa, + # typeassert, apply_type, # method reflection applicable, invoke, method_exists, # constants diff --git a/base/client.jl b/base/client.jl index 0431da800bb41..bc89ff3eb230d 100644 --- a/base/client.jl +++ b/base/client.jl @@ -334,7 +334,7 @@ function _start() global is_interactive = !isa(STDIN,Union(File,IOStream)) color_set || (global have_color = false) else - term = Terminals.UnixTerminal(get(ENV,"TERM",""),STDIN,STDOUT,STDERR) + term = Terminals.TTYTerminal(get(ENV,"TERM",""),STDIN,STDOUT,STDERR) global is_interactive = true color_set || (global have_color = Terminals.hascolor(term)) end diff --git a/base/inference.jl b/base/inference.jl index ea6f8d709785e..84d36250808e0 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -1939,6 +1939,17 @@ function inlineable(f, e::Expr, atypes, sv, enclosing_ast) return (e.args[3],()) end end + if is(f, convert_tuple) && length(atypes)==3 + # convert((T...),x::(S...)) => x, when S<:T + istuple = isa(atypes[1],Tuple) # if true, is (Type{T}, Type{S}) not Type{(T, S)} + if (istuple && all(isType,atypes[1])) || (atypes[1] <: Tuple && isType(atypes[1])) && isleaftype(atypes[1]) + tparams = (istuple ? map(t->t.parameters[1], atypes[1]) : atypes[1].parameters[1]) + if atypes[2] <: tparams + # todo: if T expression has side effects??! + return (e.args[3],()) + end + end + end if length(atypes)==2 && is(f,unbox) && isa(atypes[2],DataType) && !atypes[2].mutable && atypes[2].pointerfree # remove redundant unbox return (e.args[3],()) diff --git a/base/multi.jl b/base/multi.jl index 5eafe68476f85..abc16b30c8c9d 100644 --- a/base/multi.jl +++ b/base/multi.jl @@ -1035,7 +1035,7 @@ function create_worker(privhost, port, pubhost, stream, config, manage) @async begin while !eof(stream) line = readline(stream) - print("\tFrom worker $(wrker.id):\t",bytestring(line)) + print("\tFrom worker $(wrker.id):\t$line") end end end diff --git a/base/precompile.jl b/base/precompile.jl index 44bf5ce1d1c9e..68ee16acea8a9 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -159,25 +159,25 @@ precompile(isempty, (SubString{ASCIIString},)) precompile(!=, (SubString{ASCIIString}, ASCIIString)) precompile(print_joined, (IOBuffer, Array{SubString{ASCIIString}, 1}, ASCIIString)) precompile(push!, (Array{Union(ASCIIString, UTF8String), 1}, ASCIIString)) -precompile(Terminals.UnixTerminal, (ASCIIString, TTY, TTY, TTY)) +precompile(Terminals.TTYTerminal, (ASCIIString, TTY, TTY, TTY)) precompile(isequal, (Nothing, Nothing)) -precompile(banner, (Terminals.UnixTerminal, Terminals.UnixTerminal)) -precompile(banner, (Terminals.UnixTerminal,)) +precompile(banner, (Terminals.TTYTerminal, Terminals.TTYTerminal)) +precompile(banner, (Terminals.TTYTerminal,)) precompile(print, (IOBuffer, VersionNumber)) precompile(isequal, (VersionNumber, VersionNumber)) precompile(print, (IOBuffer, UTF8String)) precompile(VersionNumber, (Int, Int, Int, (), (ASCIIString,))) -precompile(print, (Terminals.UnixTerminal, ASCIIString)) +precompile(print, (Terminals.TTYTerminal, ASCIIString)) precompile(-, (Int,)) precompile(_setindex!, (Dict{Any, Any}, Bool, WeakRef, Int)) -precompile(REPL.LineEditREPL, (Terminals.UnixTerminal,)) +precompile(REPL.LineEditREPL, (Terminals.TTYTerminal,)) precompile(input_color, ()) precompile(async_run_thunk, (Function,)) precompile(REPL.find_hist_file, ()) precompile(LineEdit.Prompt, (Vector{Any}, ASCIIString)) precompile(REPL.run_repl, (REPL.LineEditREPL,)) precompile(REPL.LineEditREPL, - (Terminals.UnixTerminal, ASCIIString, ASCIIString, ASCIIString, ASCIIString, ASCIIString, Bool, Bool, Bool, Int)) + (Terminals.TTYTerminal, ASCIIString, ASCIIString, ASCIIString, ASCIIString, ASCIIString, Bool, Bool, Bool, Int)) precompile(REPL.start_repl_backend, (RemoteRef, RemoteRef)) precompile(REPL.respond, (Function, REPL.REPLDisplay, LineEdit.Prompt, RemoteRef, RemoteRef)) precompile(REPL.hist_from_file, (REPL.REPLHistoryProvider, IOStream)) @@ -187,15 +187,15 @@ precompile(REPLCompletions.complete_symbol, (ASCIIString, Function)) precompile(REPLCompletions.complete_path, (ASCIIString,)) precompile(REPLCompletions.complete_methods, (ASCIIString,)) precompile(LineEdit.setup_search_keymap, (REPL.REPLHistoryProvider,)) -precompile(LineEdit.run_interface, (Terminals.UnixTerminal, LineEdit.ModalInterface)) -precompile(LineEdit.prompt!, (Terminals.UnixTerminal, LineEdit.ModalInterface, LineEdit.MIState)) -precompile(Terminals.raw!, (Terminals.UnixTerminal, Bool)) +precompile(LineEdit.run_interface, (Terminals.TTYTerminal, LineEdit.ModalInterface)) +precompile(LineEdit.prompt!, (Terminals.TTYTerminal, LineEdit.ModalInterface, LineEdit.MIState)) +precompile(Terminals.raw!, (Terminals.TTYTerminal, Bool)) precompile(start_reading, (TTY,)) precompile(stop_reading, (TTY,)) precompile(LineEdit.activate, (LineEdit.Prompt, LineEdit.PromptState)) -precompile(size, (Terminals.UnixTerminal,)) +precompile(size, (Terminals.TTYTerminal,)) precompile(uv_error, (ASCIIString, Bool)) -precompile(LineEdit.clear_input_area, (Terminals.UnixTerminal, LineEdit.InputAreaState)) +precompile(LineEdit.clear_input_area, (Terminals.TTYTerminal, LineEdit.InputAreaState)) precompile(occurs_undef, (Symbol, Expr)) precompile(symequal, (Symbol, Symbol)) precompile(is_var_assigned, (Expr, Symbol)) @@ -213,7 +213,7 @@ precompile(readuntil, (IOBuffer, Uint8)) precompile(search, (IOBuffer, Uint8)) precompile(read, (IOBuffer, Type{Char})) precompile(read, (IOBuffer, Type{Uint8})) -precompile(LineEdit.write_prompt, (Terminals.UnixTerminal, LineEdit.PromptState, ASCIIString)) +precompile(LineEdit.write_prompt, (Terminals.TTYTerminal, LineEdit.PromptState, ASCIIString)) precompile(ht_keyindex2, (Dict{Uint8, Any}, Uint8)) precompile(rehash, (Dict{Uint8, Any}, Int)) precompile(setindex!, (Dict{Uint8, Any}, LineEdit.Prompt, Uint8)) @@ -232,11 +232,11 @@ precompile(getindex, (Array{LineEdit.TextInterface, 1}, Int)) precompile(start, (Array{LineEdit.TextInterface, 1},)) precompile(done, (Array{LineEdit.TextInterface, 1}, Int)) precompile(next, (Array{LineEdit.TextInterface, 1}, Int)) -precompile(LineEdit.init_state, (Terminals.UnixTerminal, LineEdit.Prompt)) +precompile(LineEdit.init_state, (Terminals.TTYTerminal, LineEdit.Prompt)) precompile(setindex!, (Dict{Any, Any}, LineEdit.PromptState, LineEdit.Prompt)) precompile(ht_keyindex2, (Dict{Any, Any}, LineEdit.Prompt)) precompile(_setindex!, (Dict{Any, Any}, LineEdit.PromptState, LineEdit.Prompt, Int)) -precompile(LineEdit.init_state, (Terminals.UnixTerminal, LineEdit.HistoryPrompt)) +precompile(LineEdit.init_state, (Terminals.TTYTerminal, LineEdit.HistoryPrompt)) precompile(setindex!, (Dict{Any, Any}, LineEdit.SearchState, LineEdit.HistoryPrompt)) precompile(ht_keyindex2, (Dict{Any, Any}, LineEdit.HistoryPrompt)) precompile(_setindex!, (Dict{Any, Any}, LineEdit.SearchState, LineEdit.HistoryPrompt, Int)) diff --git a/contrib/julia-mode.el b/contrib/julia-mode.el index 119530bef9014..a66c092745f9a 100644 --- a/contrib/julia-mode.el +++ b/contrib/julia-mode.el @@ -24,7 +24,8 @@ (modify-syntax-entry ?_ "w" table) ; underscores in words (modify-syntax-entry ?@ "w" table) (modify-syntax-entry ?. "_" table) - (modify-syntax-entry ?# "<" table) ; # single-line comment start + (modify-syntax-entry ?# "< 14" table) ; # single-line and multiline start + (modify-syntax-entry ?= ". 23bn" table) (modify-syntax-entry ?\n ">" table) ; \n single-line comment end (modify-syntax-entry ?\{ "(} " table) (modify-syntax-entry ?\} "){ " table) @@ -45,7 +46,6 @@ (modify-syntax-entry ?- "." table) (modify-syntax-entry ?< "." table) (modify-syntax-entry ?> "." table) - (modify-syntax-entry ?= "." table) (modify-syntax-entry ?% "." table) table) "Syntax table for `julia-mode'.")