Skip to content

Commit

Permalink
Work around autoload not working for execute
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 10, 2022
1 parent 41888e5 commit 4a4525c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions mathicsscript/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def main(
definitions, style, want_readline, completion, unicode, prompt
)

load_settings(shell)
# FIXME: why does load_settings fail when execute (-e) is set?
if not execute:
load_settings(shell)
if run:
with open(run, "r") as ifile:
feeder = MathicsFileLineFeeder(ifile)
Expand Down Expand Up @@ -378,6 +380,7 @@ def main(
TeXForm = Symbol("System`TeXForm")

definitions.set_line_no(0)

while True:
try:
if have_readline and shell.using_readline:
Expand All @@ -389,11 +392,11 @@ def main(
"Settings`$ShowFullFormInput"
).replace.to_python()
style = definitions.get_ownvalue("Settings`$PygmentsStyle")
fmt = lambda x: x
fmt = lambda x: x # noqa
if style:
style = style.replace.get_string_value()
if shell.terminal_formatter:
fmt = lambda x: highlight(
fmt = lambda x: highlight( # noqa
str(query), mma_lexer, shell.terminal_formatter
)

Expand Down
2 changes: 1 addition & 1 deletion mathicsscript/data/inputrc-no-unicode
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GNU Readline input unicode translations
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Oct 26 04:49:35 PM EDT 2022
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Oct 26 05:37:20 PM EDT 2022

"\ea'\e": "á"
"\ea-\e": "ā"
Expand Down
2 changes: 1 addition & 1 deletion mathicsscript/data/inputrc-unicode
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GNU Readline input unicode translations
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Oct 26 04:49:35 PM EDT 2022
# Autogenerated from mathics_scanner.generate.rl_inputrc on Wed Oct 26 05:37:20 PM EDT 2022

"\ea'\e": "á"
"\ea-\e": "ā"
Expand Down

0 comments on commit 4a4525c

Please sign in to comment.