Barry Warsaw [Wed, 26 Nov 1997 06:00:26 +0000 (06:00 +0000)]
(py-mark-def-or-class): Added an exchange-point-and-mark and a
py-keep-region-active so that the marked def/class gets the
zmacs-region or transient-mark region highlighted. Also point should
be left at the end of the marked region.
(py-mode-map): Moved py-mark-def-or-class to M-C-h to conform to Emacs
major mode standards.
Barry Warsaw [Wed, 26 Nov 1997 01:04:44 +0000 (01:04 +0000)]
Added comment about where to find details on python-mode.el, pointing
to the Web site.
(py-defun-start-re, py-class-start-re): Changed to defconst.
(py-traceback-line-re): Regular expression describing what traceback
lines look like.
(py-point): New defsubst copied from CC Mode.
(py-highlight-line): Function which does the work of making a
traceback line mouseable. This only works on XEmacs. Someone familar
with Emacs text properties and such will have to do that port.
(py-mode-map): Added C-c- bound to py-up-exception and C-c= bound to
py-down-exception. Also, more concise form for mapcar.
(py-mode-output-map): New keymap for the *Python Output* buffer which
only has keybindings for py-mouseto-exception and py-goto-exception.
All other self-insert-command's are bound to beep. This is actually
bogus because the buffer should really be made read-only and the
functions that insert in that buffer should bind inhibit-read-only.
Also, this map should be bound to highlighted extents in a *Python*
shell buffer, but this stuff hasn't been migrated into there.
(py-postprocess-output-buffer): New function which extentifies the
*Python Output* buffer. The bogosities are that this only runs when
the synchronous process in the buffer is finished (so it doesn't work
for async procs), and it should also be merged into py-process-filter
so the *Python* shell gets mouseable too.
(py-shell): Added C-c- and C-c= to the comint buffer's keymap. The
bogosity is that py-goto-exception should also be bound, but it cannot
be bound to C-cC-c (since that interferes with
comint-interrupt-subjob's typical binding). Also, traceback lines
aren't mouseable in this buffer.
(py-execute-region): Support for traceback jumping. This really is
quite a kludge, but necessary based on the way all this stuff works.
There's bound to be broken interactions here.
(py-jump-to-exception, py-mouseto-exception, py-goto-exception,
py-find-next-exception, py-down-exception, py-up-exception): All new
commands and functions to implement traceback jumping.
(py-compute-indentation): Hope this change doesn't get lost in all the
noise above!!!! This fixes broken non-indentation of a line when TAB
is hit inside a string that isn't a multi-line string.
Guido van Rossum [Tue, 25 Nov 1997 20:58:13 +0000 (20:58 +0000)]
Apply str() to sys.ps1 or sys.ps2 before using them as a prompt, so
you can assign an object whose str() evaluates to the current
directory (or whatever).
Fred Drake [Tue, 25 Nov 1997 04:06:21 +0000 (04:06 +0000)]
Added the "italic correction" command ("\/") to the list of ignored commands.
There is at least one of there in the library reference, and this reduces
the warning count. We *do* know what to do with it!
Fred Drake [Tue, 25 Nov 1997 04:04:00 +0000 (04:04 +0000)]
Removed leading comment about this being "introductory" documentation;
compared to most, I'd say this section is fairly thorough.
Fixed \indexsubitem definitions for symbol and token module sub-documents.
Perhaps these should be moved to their own files, but they're awefully
small.
Guido van Rossum [Mon, 24 Nov 1997 17:36:21 +0000 (17:36 +0000)]
Change the option used on Linux to export all symbols
from the main program to shared libraries. On mklinux, the old
'-rdynamic' doesn't work; the new '-Xlinker -export-dynamic' works
both there and on Intel Linux platforms.
Barry Warsaw [Thu, 20 Nov 1997 19:56:38 +0000 (19:56 +0000)]
(Queue.Empty): When class based exceptions are in force, derive this
class from the standard base exception Exception. Otherwise define
Queue.Empty as a string exception.
(Queue): 8-space to 4-space indentation conversion. Also, basically
recast all method comments into docstrings.
Guido van Rossum [Wed, 19 Nov 1997 19:01:43 +0000 (19:01 +0000)]
User-level locale module. A wrapper around _locale which adds
format(), str(), atof(), and atoi(). The last three are locale
sensitive versions of the corresponding standard functions (only for
numbers though); format() does general %[efg] formatting taking the
locale into account, optionally with thousands grouping.
Guido van Rossum [Wed, 19 Nov 1997 18:53:33 +0000 (18:53 +0000)]
Fix importing of shared libraries from inside packages.
This is a bit of a hack: when the shared library is loaded, the module
name is "package.module", but the module calls Py_InitModule*() with just
"module" for the name. The shared library loader squirrels away the true
name of the module in _Py_PackageContext, and Py_InitModule*() will
substitute this (if the name actually matches).
Guido van Rossum [Wed, 19 Nov 1997 16:15:37 +0000 (16:15 +0000)]
Two changes (here we go again :-( ).
1) The __builtins__ variable in the __main__ module is set to the
__builtin__ module instead of its __dict__.
2) Get rid of the SIGHUP and SIGTERM handlers. They can't be made to
work reliably when threads may be in use, they are Unix specific, and
Python programmers can now program this functionality is a safer way
using the signal module.
Guido van Rossum [Wed, 19 Nov 1997 16:03:17 +0000 (16:03 +0000)]
Add a new function PyNumber_CoerceEx() which works just like
PyNumber_Coerce() except that when the coercion can't be done and no
other exceptions happen, it returns 1 instead of raising an
exception.
Use this function in PyObject_Compare() to avoid raising an exception
simply because two objects with numeric behavior can't be coerced to a
common type; instead, proceed with the non-numeric default comparison.
Note that this is a somewhat questionable practice -- comparisons for
numeric objects shouldn't default to random behavior like this, but it
is required for backward compatibility. (Case in point, it broke
comparison of kjDict objects to integers in Aaron Watters' kjbuckets
extension.) A correct fix (for python 2.0) should involve a different
definiton of comparison altogether.
Guido van Rossum [Tue, 18 Nov 1997 19:23:07 +0000 (19:23 +0000)]
Undo another glitch of the automatic not-so-Grand Renaming; some local
variables called 'coerce' were accidentally renamed to
'PyNumber_Coerce'. Rename them back to coercefunc.
Guido van Rossum [Fri, 14 Nov 1997 22:24:28 +0000 (22:24 +0000)]
This fix (across 4 files in 3 directories) solves a subtle problem with
signal handlers in a fork()ed child process when Python is compiled with
thread support. The bug was reported by Scott <scott@chronis.icgroup.com>.
What happens is that after a fork(), the variables used by the signal
module to determine whether this is the main thread or not are bogus,
and it decides that no thread is the main thread, so no signals will
be delivered.
The solution is the addition of PyOS_AfterFork(), which fixes the signal
module's variables. A dummy version of the function is present in the
intrcheck.c source file which is linked when the signal module is not
used.
Guido van Rossum [Tue, 11 Nov 1997 18:29:22 +0000 (18:29 +0000)]
Suggestion by David Ascher: set EXE macro to empty string and use it
in a few places -- so it can be set to .exe on GNUWIN32 platforms and
do the right thing. Whatever. (This was already done in
Modules/Makefile* but wasn't carried over here.)
Guido van Rossum [Tue, 11 Nov 1997 17:18:48 +0000 (17:18 +0000)]
Use a %s format for the exit status -- through the magical workings of
the aptly named MagicDict class, the value is a string, not a number,
by the time it is printed...
All geometry manager methods that apply to a master widget instead of
to a slave widget have been moved to the Misc class, which is
inherited by all of Tk(), Toplevel() and Widget(). They have been
renamed to have their geometry manager name as a prefix,
e.g. pack_propagate(); the short names can still be used where
ambiguities are resolved so that pack has priority over place has
priority over grid (since this was the old rule).
Also, the method definitions in the Pack, Place and Grid classes now
all have their respective geometry manager name as a prefix
(e.g. pack_configure); the shorter names are aliases defined through
assignment.
A similar renaming has been done for all config() methods found
elsewhere; these have been renamed to configure() with config being
the alias (instead of the other way around). (This may not make much
of a difference but the official Tk command name is now 'configure'
and it may help in debugging tracebacks.)
Finally, a new base class BaseWidget has been introduced, which
implements the methods common between Widget and Toplevel (the
difference between those two classes is that Toplevel has a different
__init__() but also that Toplevel doesn't inherit from Pack, Place or
Grid.