Commit Graph

407 Commits

Author SHA1 Message Date
Barry Warsaw 742a5116d2 (py-smart-indentation): New variable which controls the automagic
setting of py-indent-offset and indent-tabs-mode.

(python-mode): After python-mode-hook is run, do the automagic
calculation if py-smart-indentation is non-nil.

(py-parse-state): Get rid of unused variable to quiet the
byte-compiler.
1998-03-13 17:29:15 +00:00
Guido van Rossum 38d3fe012e Add LINKFORSHARED and LDLAST as in the main Makefile. 1998-03-11 17:49:55 +00:00
Barry Warsaw 2f32fbba34 (py-execute-region): Simplified calculation of temporary file name.
When running synchronously in a subproc buffer, be sure to
pop-to-buffer so the output is visible.
1998-02-25 16:45:43 +00:00
Barry Warsaw 6c6db0a073 (py-temp-directory): Minor docstring nit. 1998-02-25 16:33:56 +00:00
Barry Warsaw 50b3eb6a9e (py-master-file): Fixed some typos in the docstring. 1998-02-25 15:57:47 +00:00
Barry Warsaw f64b4054af (py-compute-indentation): Several changes made to improve navigation
over and around triple-quoted strings:

    - move the beginning-of-line to above the p-p-s call

    - in the `t' clause of the big cond, where we skip over
      triple-quoted strings, first find out if we're looking at a
      single or TQS, then skip over it in one fell swoop, instead of
      trying to loop over skipage of SQS's.

(py-parse-state): Implement XEmacs only hack to more accurately figure
out whether we're in a string or not.  Can't do this in Emacs because
it lacks the necessary primitive, so we just do it the old (and mostly
accurate, but foolable) way for Emacs.
1998-02-12 16:52:14 +00:00
Barry Warsaw 8ee4a60c70 (py-scroll-process-buffer): Default value changed to nil to act more
like default shell-mode behavior.
1998-02-06 16:01:52 +00:00
Barry Warsaw f1b3e89800 (py-parse-state): When looking for landing inside triple-quoted
string, don't check for indentation at column zero.  This will falsely
hit a line inside a docstring that starts at column zero but ends in a
colon.
1998-02-05 23:35:09 +00:00
Barry Warsaw 8f972b762a (py-python-command-args): New variable, allows user to customize the
arguments past to py-python-command when invoking the Python shell.
1998-02-05 20:45:49 +00:00
Barry Warsaw f06777dd7c (py-outdent-p): When looking at the previous line, watch out for
continuation lines.  This fixes this bug report, reported by Frank
Stajano.

# But if I split the "raise" line and reindent, the else WRONGLY goes up a
# level (?!?)

while condition1:
    if condition2:
        raise error3, \
              moreInfo4
else: # meant to close "if condition2"
    action5()
1998-01-21 05:36:18 +00:00
Barry Warsaw 9ec9fbc355 (py-goto-initial-line): Shut up the byte compiler. 1998-01-21 05:15:57 +00:00
Barry Warsaw 82aecb9d66 (py-mode-map): Add a binding of C-m to py-newline-and-indent. This is
a religious issue: RMS decrees that the Enter (RET) key should just do
a newline and a LFD (C-j) should do a newline and indent (i.e. the
python-mode version of this).  Almost everyone I know disagrees and
finds that RET should do newline and indent.  Almost everyone hacks
their modes to do this, if they know how.  Because it's hard for
newbies to figure out how to do this, and because most DOS keyboards
lack a LFD (leaving users to the more obscure C-j), I think it makes
better sense to add this default binding.
1998-01-21 05:14:24 +00:00
Barry Warsaw c210e69981 (py-compute-indentation): In the most common case, where indentation
is based on the line above, watch out for landing inside a triple
quoted string.  In this case, use iterative search +
parse-partial-sexp backwards to find the beginning of the string.

Note this does affect performance, but very little in the common cases
(I hope).  It could be made *much* faster by adding Emacs and XEmacs
dependent code -- different code naturally.  :-(

Fixes the following reported bug:

if len(sys.argv) >= 6:
    # More lines here
    fptr = open('/etc/hosts', 'w')
    fptr.write("""# /etc/hosts -- autocreated by /etc/ppp/ip-up
#
# Address from pppd
%-15s	%s

# For loopbacking
127.0.0.1	localhost

255.255.255.255	broadcast
""" % (ipaddr, ipname) )

os.chmod('/etc/hosts', 0644)
1998-01-20 22:52:56 +00:00
Barry Warsaw c0ecb53194 (py-master-file): New buffer-local variable which can be set in the
file local variable section of a file.  When set, and the user hits
C-c C-c, this file gets executed instead of the buffer's file.  Idea
given by Roy Dragseth <royd@math.uit.no>, but implemented differently.

(py-execute-buffer): Support py-master-file variable.  If this names a
relative path, default-directory is prepended via expand-file-name.
1998-01-20 21:43:34 +00:00
Guido van Rossum b25c0e739c delete gMakefile, clarify Makefile.pre.in 1998-01-13 18:53:42 +00:00
Guido van Rossum 5eb3f90ad5 No longer needed, sez Jim. 1998-01-13 18:52:40 +00:00
Guido van Rossum fbea1d35db Added from 1.5b2 to 1.5. 1997-12-31 00:04:35 +00:00
Guido van Rossum 14777f87d8 New blood. 1997-12-30 04:31:04 +00:00
Guido van Rossum 105ff952bd Typed in the relevant changes since 1.5b1. 1997-12-11 20:35:47 +00:00
Guido van Rossum 5a978dc7e5 Doug Marien. 1997-12-11 20:24:38 +00:00
Barry Warsaw 3723152c5b Update to the Big Comment at the top of the file. It should better
explain what the users of the various Emacsen have to do to get this
all working.
1997-12-11 17:23:13 +00:00
Guido van Rossum 87908f5925 New names. 1997-12-10 18:57:35 +00:00
Barry Warsaw 5ea20d52c7 Added some links to OO-Browser, given by Harri Pasanen.
Updated the to do list.
1997-12-06 00:00:47 +00:00
Barry Warsaw 9981d2226d (py-jump-on-exception): Variable which if t, means that if an
exception occurs in a synchronous Python subprocess, the mode will
automatically jump to the innermost exception.
1997-12-03 05:25:48 +00:00
Barry Warsaw 27ee115fd7 Removed redundant eval-when-compile.
(python-mode): Conditionalize imenu initializations to when we can
safely require imenu.  Under Emacs this should prevent python-mode
from hosing the global value of imenu-create-index-function and
messing things up for all other modes.  Problem identified by
Christian Egli.

(py-describe-mode): py-delete-char => py-electric-backspace.  Given by
Christian Egli.
1997-12-03 05:03:44 +00:00
Barry Warsaw 5c38bf6c62 (python-mode): Patch to make font-lock work automatically for Emacs.
Unnecessary for XEmacs, but oh well...
1997-12-02 22:01:04 +00:00
Barry Warsaw 673d05f0ee Test for an up-to-date Custom library when byte-compiling, and issue
an informative message when one cannot be found, as is the case with a
vanilla Emacs 19.34 (and NTEmacs 19.34).
1997-12-02 21:51:57 +00:00
Guido van Rossum 2888a12eed Add attributions to Jeffrey Ollie and Tim Peters for re.py. 1997-12-02 19:44:54 +00:00
Barry Warsaw 8529ebb78c Require 'cl when compiling so that the push macro gets picked in Emacs
19.34.
1997-12-01 20:03:12 +00:00
Barry Warsaw ffbc17da19 (py-traceback-line-re): Relaxation of regexp to catch SyntaxErrors.
Harri Pasanen.
1997-11-27 20:08:14 +00:00
Barry Warsaw f471056b0a (py-process-filter): py-delete-file-silently is obsolete. Use a
py-safe wrapped delete-file call instead.
1997-11-26 21:00:36 +00:00
Barry Warsaw 3b3ff4e96e (py-compute-indentation): Check for multiline stringness and
commentness so that hitting TAB in the middle of a comment will still
indent the line.
1997-11-26 20:58:48 +00:00
Barry Warsaw 8c4a8de75e (py-mode-map): Bind py-mark-def-or-class to C-M-h with a different
spelling so that it doesn't clobber the standard M-BS binding.  This
should be portable between X/Emacsen.
1997-11-26 20:30:33 +00:00
Guido van Rossum 7ea639b133 Added list of what's new in 1.5b1. Changed intro and some section titles. 1997-11-26 16:36:28 +00:00
Guido van Rossum 4d8e7c5464 Four more valuable contributors... 1997-11-26 16:35:55 +00:00
Barry Warsaw c8520351af (python-mode): Make imenu-create-index-function buffer local.
(imenu-example--create-python-index-engine): Use
buffer-substring-no-properties.  Also, don't use
imenu-create-submenu-name.  Apparently it is obsolete.

These Imenu patches were given by Christian Egli
<christian.egli@stest.ch>
1997-11-26 06:14:40 +00:00
Barry Warsaw 4da6bd51dd (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.
1997-11-26 06:00:26 +00:00
Barry Warsaw e467bfbfe9 (python-mode): Patch to fix Imenu support under Emacs, given by
Torsten Hilbrich <Torsten.Hilbrich@bln.de>.
1997-11-26 05:40:58 +00:00
Barry Warsaw 47384789b2 (py-kill-emacs-hook): Simplification. 1997-11-26 05:27:45 +00:00
Barry Warsaw a0ee8cd982 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.
1997-11-26 01:04:44 +00:00
Guido van Rossum 4aa6186216 Drop Capitalized Important Words. 1997-11-25 15:40:06 +00:00
Guido van Rossum 275feea40f New names... 1997-11-24 17:50:47 +00:00
Guido van Rossum 4a9aff2eba A comparison with several other languages that also appears in the
Handbook of Object Technology.
1997-11-20 21:15:28 +00:00
Guido van Rossum 51bb7b7940 Dang. Formatting glitch. 1997-11-20 15:42:46 +00:00
Guido van Rossum f5831ae92e New blurb, derived from my Handbook of Object Technology abstract. 1997-11-20 15:42:18 +00:00
Guido van Rossum 6f5a312cec New version from Neale... He promised it's the last. 1997-11-11 16:36:14 +00:00
Guido van Rossum 3120bc3888 v1.1; added attribution to Neale Pickett. 1997-11-08 07:16:19 +00:00
Guido van Rossum 1abbd7f3f1 Added vgrindefs. 1997-11-07 19:58:10 +00:00
Guido van Rossum 93a47d7c3c Plucked this from the net. 1997-11-07 19:57:54 +00:00
Barry Warsaw 6ae21ad687 #(py-emacs-features): Fixed typo in docstring. 1997-11-06 14:36:49 +00:00
Barry Warsaw b8f1166922 (python-font-lock-keywords): Pick up block introducing keywords with
immediately following colons.  Sjoerd noticed this one too.  Here's a
nonsense.py file that flexes all the font-lock keyword combinations.

class A:
    class B(A):
	pass
    def __init__(self):
	if i == 2 and j == 3 or k == 4:
	    import stuff
	    from otherstuff import cool
	    for i in range(cool.count):
		if i == j:
		    break
		elif j == 1:
		    continue
		print i
	    else:
		return not i
	elif q is not i:
	    return lambda x: x + 1
	else:
	    try:
		try:
		    raise stuff.error
		except stuff.error, v:
		    print v
		except:
		    global q
	    finally:
		while q > 0:
		    q = q - 1
		assert q == 0

def make():
    a = A()
    exec "nonsense"
    del a
1997-11-06 14:35:15 +00:00
Barry Warsaw ef3c891773 (python-font-lock-keywords): Fix for consecutive keyword font locking,
given by Sjoerd Mullender <Sjoerd.Mullender@cwi.nl>.
1997-11-05 18:55:50 +00:00
Barry Warsaw 5e21cb0bfb (py-emacs-features): Test for working make-temp-name, which is broken
on NTEmacs 19.34.6.

(py-serial-number): New variable.

(py-execute-region): If make-temp-name is broken, simply append a
serial number to the string "python-" to get a temporary file name.
It's possible concurrent NTEmacs can step on each others toes, but it
makes no sense to further coddle a busted NTEmacs.
1997-11-05 18:41:11 +00:00
Guido van Rossum 2bd358c9fd A nice blurb that Mark Hammond wrote, aimed at Windows users. 1997-11-05 17:15:02 +00:00
Barry Warsaw a9ce70f3bc (py-execute-region): Fixed small bug with queuing file for execution
in a py-shell.  Temp files now get cleaned up.
1997-11-05 16:56:51 +00:00
Barry Warsaw 2518c67984 (mark-python-def-or-class): Renamed to py-mark-def-or-class globally.
(py-mode-map): Moved py-mark-def-or-class from M-C-h to C-c C-m since
the old binding conflicts with the standard global backward-kill-word
binding, and this new binding is more conformant with other language
modes.  Moved py-mark-block to C-c C-k.
1997-11-05 00:51:08 +00:00
Barry Warsaw 6d48c4a00b (py-backspace-function): New variable.
(py-electric-backspace, py-electric-delete): Support the XEmacs 20 Way
for backspace and delete mappings.  In XEmacs 19, Emacs 19, and Emacs
20, both backspace and delete keysyms are bound to
py-electric-backspace.  In XEmacs 20, backspace and delete keysyms are
bound separately, allowing the user to specify forward or backward
deletion of the delete keysym through the variable
delete-key-deletes-forward.  All this is the Right Way To Do It and
this implementation was largely ripped from CC Mode.
1997-11-04 19:21:50 +00:00
Barry Warsaw a97a3f34d6 First round of changes, mostly subprocess stuff.
(py-execute-file): Better interaction with comint.  Set
comint-scroll-to-bottom-on-output to t.  Wrapper buffer change in
unwind-protect in case process filter fails.

(py-shell): Start Python with -i flag to fix tty problem on Windows;
presumably -- not yet tested.

(py-clear-queue): New function to clear the pending exec file queue.
Not currently keybound.

(py-execute-region, py-execute-buffer): Added optional async flag (use
via C-u prefix) to execute the region in a new asynchrous buffer, even
if the Python shell is running.

(py-append-to-process-buffer): Removed as obsolete.  Comint provides
this functionality.

Removed fbound test defun of match-string.  All modern X/Emacsen have
this function.
1997-11-04 18:47:06 +00:00
Guido van Rossum 615022fbf8 Doing the most complicated CVS dance I've ever seen. Barry has had
his *own* RCS file for python-mode.el, and I've agreed that it would
be better if his version was in the Python source tree.  However I
don't want to totally get rid of the old RCS file (which has
interesting info such as which version was in which Python release).
So I've moved the old one to python-mode-old.el behind the scenes,
and this checkin message indicates that I'm now deleting it.
If you do an update, you will actually get Barry's *new* version!
1997-11-03 17:14:19 +00:00
Barry Warsaw affc0ca0e8 Changes in preparation for integrating into the Python CVS tree.
Introductory comment updates.

(python-font-lock-keywords): Added "assert"

(py-block-closing-keywords-re): New variable.

(py-no-outdent-re): Rewrite to use py-block-closing-keywords-re.

(py-shell): py-process-filter should no longer be necessary.  Comint
should do all the work.  Note that more fixes to the py-shell process
mechanism need to be done.

(py-execute-region): Check for empty region.  Some questionable
changes to set-buffer after shell-command-on-region.  Again, this all
needs to be closely examined for X/Emacs 19/20 compatibility.

(py-goto-beyond-final-line): py-parse-partial-sexp-works-p should no
longer be necessary.

(py-statement-closes-block-p): Use py-block-closing-keywords-re.
1997-11-03 16:59:38 +00:00
Guido van Rossum 9a513efffa Final touch -- Don's SGI_ABI patches. 1997-10-09 23:32:24 +00:00
Guido van Rossum 91922677ea Don Beaudry's changes to support SGI_ABI on Irix 6.x. 1997-10-09 20:24:13 +00:00
Guido van Rossum 764a377cef Typo in description of news in errno; added setlocale() call. 1997-10-08 22:49:49 +00:00
Guido van Rossum b68b77f62d A few last-minute additions and some rearrangements and corrections.
What's "xlib"?  I took the line that mentioned it out.
1997-10-07 19:12:50 +00:00
Barry Warsaw 93374539ad Updated for Python 1.5, including my experiences with Purify on
Solaris 2.6 and with a threaded interpreter.  I also included my name
and email address.
1997-10-07 15:50:58 +00:00
Guido van Rossum 43b26ea0fa Whole bunch of additions... 1997-10-07 14:52:19 +00:00
Guido van Rossum 92664b890b Completed the changes between 1.5a3 and now. Not yet sorted though. 1997-10-07 00:12:43 +00:00
Guido van Rossum 1f83ccee88 Done with adding changes from 1.4 till 1.5a3. 1997-10-06 21:04:35 +00:00
Guido van Rossum 474ba3bd46 The directory containing config.h has changed. 1997-10-05 03:01:28 +00:00
Fred Drake bfeb74d4ca install: New target that installs shared modules in
$exec_prefix/lib/python$VERSION/site-packages by default.
1997-10-04 04:56:40 +00:00
Guido van Rossum 4cf4de5d11 Brought up to date with new options and env vars. 1997-09-08 04:06:15 +00:00
Barry Warsaw c12c62ee5a (py-parse-partial-sexp-works-p): Removed as obsolete. All current
Emacs and XEmacs versions should have working parse-partial-sexp's.

(py-emacs-features): Defined as future placeholder.
1997-09-04 04:18:07 +00:00
Guido van Rossum 522578e90f Complete log of changes since 1.5a3 at the end. 1997-08-28 03:43:21 +00:00
Guido van Rossum 2da391f387 I'm tired -- checking in more news items. This isn't complete; I'm
about halfways.
1997-08-18 21:17:32 +00:00
Guido van Rossum 6688d35c43 Removed ancient FAQ from distribution 1997-08-18 19:55:01 +00:00
Guido van Rossum 61000333bf Another checkpoint -- reorganized, in sections. 1997-08-15 04:39:58 +00:00
Guido van Rossum 34900f8147 . 1997-08-15 02:52:20 +00:00
Guido van Rossum f0b69f01eb Checkpoint checkin of list of changes. Much more to follow, but it's
late...
1997-08-15 02:50:47 +00:00
Barry Warsaw 516b6208c7 #Fixed two byte-compiler errors 1997-08-09 06:43:20 +00:00
Barry Warsaw c72c11c9e3 #Checkpointing X/Emacs 20'fication of this mode. 1997-08-09 06:42:08 +00:00
Barry Warsaw 7d6b7d3f54 #Bumping to version 3.0 1997-08-08 16:19:03 +00:00
Guido van Rossum fb84255e67 New version of Vladimir Marangozov's AIX hacks -- simpler etc. 1997-08-06 23:42:07 +00:00
Guido van Rossum bef03ae032 Adapted to the new build system. 1997-07-19 22:52:43 +00:00
Guido van Rossum 8aea8d9600 Remove -s option and $PYTHONSUPPRESS environment variable. 1997-07-19 20:46:22 +00:00
Guido van Rossum 5624abd086 Emptied (in expectation of a laundry list of what's new in 1.5). 1997-07-19 20:45:30 +00:00
Guido van Rossum ecd3b153d5 Added note about libpython1.5.a. 1997-07-19 20:44:33 +00:00
Guido van Rossum 132cd063f5 Some new names. 1997-07-19 20:44:09 +00:00
Barry Warsaw e6648967b7 (py-shell): Remove support for Emacs 18, implicitly add support for
Emacs 20, and bind TAB key to self-insert-command in *Python* process.
1997-07-10 15:58:36 +00:00
Guido van Rossum 821a558f39 Moved the 1.4 NEWS file here (it had to happen someday...). 1997-05-23 04:05:31 +00:00
Guido van Rossum cbf1b9c40e Added warning about the optimizer bug on AIX 4.2.1 1997-05-22 20:20:57 +00:00
Guido van Rossum d0c87ee6c4 Oops, another forgotten renaming: varobject -> PyVarObject. 1997-05-15 21:31:03 +00:00
Guido van Rossum 6a9ee0eeaf New heros. 1997-05-09 03:21:12 +00:00
Guido van Rossum b6a7f77c9f Oops -- missed FloatingPointError in renaming. 1997-05-09 03:03:23 +00:00
Guido van Rossum 45510aee8f Fix old typo PyArgs_VaParse -> PyArg_VaParse. 1997-05-05 21:53:03 +00:00
Guido van Rossum 1a43ce848b Added inittab. 1997-04-29 20:22:47 +00:00
Guido van Rossum 04e30c188a Remove err_input from rename list -- it is a static inside errors.c. 1997-04-29 18:25:32 +00:00
Guido van Rossum 58d8e3dd9e Remove renaming instructions for ANY -- this is not renamed in
mymalloc.h.  (Since it's a macro, I don't care much.  It is used
internally only; others can use void *.)
1997-04-29 18:19:10 +00:00
Guido van Rossum 5d88aa3a36 Oops, added <URL:...> around the URL. 1997-04-11 16:46:56 +00:00
Guido van Rossum 24c93591cd (Sjoerd:) Incorporate `build number' stuff. 1997-04-11 15:25:47 +00:00
Guido van Rossum 44adb0c95f Added note about SWIG (replacing a whole lot of nonsense about how
difficult it is to do).
1997-04-11 15:19:35 +00:00