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

Work around autoload not working for execute #68

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autoblack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: If needed, commit black changes to the pull request
if: failure()
run: |
black .
black --diff .
git config --global user.name 'autoblack'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
Expand Down
5 changes: 3 additions & 2 deletions mathicsscript/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,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 +390,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
15 changes: 8 additions & 7 deletions mathicsscript/autoload/settings.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,28 @@
"

Settings`$ShowFullFormInput = False

Settings`$PygmentsStyle = "inkpot"
Settings`$PygmentsStyle::usage = "This variable sets the Pygments style used to colorize output. The value should be a string.

The default value changes background depending on whether the terminal has a light or dark background. You can also set the color style used on the command with the ``--style`` option, or look at the variable ```Settings`PygmentsStylesAvailable```. Or it can be set in the settings.m file."

Settings`$PygmentsShowTokens::usage = "Setting this variable True will show Pygments tokenization of the output."

Settings`$PygmentsShowTokens = False
Settings`$PygmentsShowTokens::usage = "Setting this variable True will show Pygments tokenization of the output."

Settings`$UseUnicode::usage = "This Boolean variable sets whether Unicode is used in terminal input and output."
Settings`$UseUnicode = True
Settings`$UseUnicode::usage = "This Boolean variable sets whether Unicode is used in terminal input and output."

Settings`$UseAsymptote::usage = "This Boolean variable sets whether 3D Graphics should render using Asymptote."
Settings`$UseAsymptote = True
Settings`$UseAsymptote::usage = "This Boolean variable sets whether 3D Graphics should render using Asymptote."

Settings`$UseMatplotlib::usage = "This Boolean variable sets whether 2D Graphics should render using Matplotlib."
Settings`$UseMatplotlib = True
Settings`$UseMatplotlib::usage = "This Boolean variable sets whether 2D Graphics should render using Matplotlib."

Settings`MathicsScriptVersion::usage = "This string is the version of MathicsScript we are running."

System`$Notebooks::usage = "Set True if the Mathics is being used with a notebook-based front end."
System`$Notebooks = False
System`$Notebooks::usage = "Set True if the Mathics is being used with a notebook-based front end."

Settings`$GroupAutocomplete::usage = "This Boolean variable sets whether mathicsscript should automatically close braces."
Settings`$GroupAutocomplete = True
Settings`$GroupAutocomplete::usage = "This Boolean variable sets whether mathicsscript should automatically close braces."
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