diff options
author | Barry Warsaw <barry@python.org> | 2002-04-25 21:31:47 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2002-04-25 21:31:47 (GMT) |
commit | 884916112e317d9a590346b7b85199eb7dc98758 (patch) | |
tree | f11765eae81e60db6a5331343f8fca551f1597a1 /setup.py | |
parent | c95cc87447f4c9f3f9f0d17481ddaed313bfc7ac (diff) | |
download | cpython-884916112e317d9a590346b7b85199eb7dc98758.zip cpython-884916112e317d9a590346b7b85199eb7dc98758.tar.gz cpython-884916112e317d9a590346b7b85199eb7dc98758.tar.bz2 |
SF patch #510288 by Kevin J. Butler, mod'd by Barry. This provides
better auto-recognition of a Jython file vs. a CPython (or agnostic)
file by looking at the #! line more closely, and inspecting the import
statements in the first 20000 bytes (configurable). Specifically,
(py-import-check-point-max): New variable, controlling how far into
the buffer it will search for import statements.
(py-jpython-packages): List of package names that are Jython-ish.
(py-shell-alist): List of #! line programs and the modes associated
with them.
(jpython-mode-hook): Extra hook that runs when entering jpython-mode
(what about Jython mode? <20k wink>).
(py-choose-shell-by-shebang, py-choose-shell-by-import,
py-choose-shell): New functions.
(python-mode): Use py-choose-shell.
(jpython-mode): New command.
(py-execute-region): Don't use my previous hacky attempt at doing
this, use the new py-choose-shell function.
One other thing this file now does: it attempts to add the proper
hooks to interpreter-mode-alist and auto-mode-alist if they aren't
already there. Might help with Emacs users since that editor doesn't
come with python-mode by default.
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions