Commit Graph

10913 Commits

Author SHA1 Message Date
Guido van Rossum 6290dabdbb A version that Mark Hammond posted to the newsgroup. Has some newer
stuff for getting the tip.  Had to fix the Key-( and Key-) events
for Unix.  Will have to re-apply my patch for catching KeyRelease and
ButtonRelease events.
1999-06-02 18:12:55 +00:00
Guido van Rossum 85b9735768 Call tips by Mark Hammond (plus tiny fix by me.) 1999-06-02 16:10:19 +00:00
Guido van Rossum 1709041e73 Changes by Mark Hammond: (1) support optional output_sep argument to
the constructor so he can eliminate the sys.ps2 that PythonWin leaves
in the source; (2) remove duplicate history items.
1999-06-02 12:06:47 +00:00
Guido van Rossum 808fa4993e Changes by Mark Hammond to allow using IDLE extensions in PythonWin as
well: make three dialog routines instance variables.
1999-06-02 11:05:19 +00:00
Guido van Rossum d395aeeaa4 Change by Mark Hammond to allow using IDLE extensions in PythonWin as
well: make three dialog routines instance variables.
1999-06-02 11:04:29 +00:00
Guido van Rossum a954ba1d6c Hah! A fix of my own to Tim's code!
Unix bindings for <<toggle-tabs>> and <<change-indentwidth>> were
missing, and somehow that meant the events were never generated,
even though they were in the menu.  The new Unix bindings are now
the same as the Windows bindings (M-t and M-u).
1999-06-01 20:06:44 +00:00
Guido van Rossum bbaba85402 Tim Peters again:
The new version (attached) is fast enough all the time in every real module
I have <whew!>.  You can make it slow by, e.g., creating an open list with
5,000 90-character identifiers (+ trailing comma) each on its own line, then
adding an item to the end -- but that still consumes less than a second on
my P5-166.  Response time in real code appears instantaneous.

Fixed some bugs.

New feature:  when hitting ENTER and the cursor is beyond the line's leading
indentation, whitespace is removed on both sides of the cursor; before
whitespace was removed only on the left; e.g., assuming the cursor is
between the comma and the space:

def something(arg1, arg2):
                   ^ cursor to the left of here, and hit ENTER
               arg2):   # new line used to end up here
              arg2):    # but now lines up the way you expect

New hack:  AutoIndent has grown a context_use_ps1 Boolean config option,
defaulting to 0 (false) and set to 1 (only) by PyShell.  Reason:  handling
the fancy stuff requires looking backward for a parsing synch point; ps1
lines are the only sensible thing to look for in a shell window, but are a
bad thing to look for in a file window (ps1 lines show up in my module
docstrings often).  PythonWin's shell should set this true too.

Persistent problem:  strings containing def/class can still screw things up
completely.  No improvement.  Simplest workaround is on the user's head, and
consists of inserting e.g.

def _(): pass

(or any other def/class) after the end of the multiline string that's
screwing them up.  This is especially irksome because IDLE's syntax coloring
is *not* confused, so when this happens the colors don't match the
indentation behavior they see.
1999-06-01 19:55:34 +00:00
Guido van Rossum a6be3870b3 Tim Peters again:
[Tim, after adding some bracket smarts to AutoIndent.py]
> ...
> What it can't possibly do without reparsing large gobs of text is
> suggest a reasonable indent level after you've *closed* a bracket
> left open on some previous line.
> ...

The attached can, and actually fast enough to use -- most of the time.  The
code is tricky beyond belief to achieve that, but it works so far; e.g.,

        return len(string.expandtabs(str[self.stmt_start :
                                         ^ indents to caret
                                         i],
                                     ^ indents to caret
                                     self.tabwidth)) + 1
    ^ indents to caret

It's about as smart as pymode now, wrt both bracket and backslash
continuation rules.  It does require reparsing large gobs of text, and if it
happens to find something that looks like a "def" or "class" or sys.ps1
buried in a multiline string, but didn't suck up enough preceding text to
see the start of the string, it's completely hosed.  I can't repair that --
it's just too slow to reparse from the start of the file all the time.

AutoIndent has grown a new num_context_lines tuple attribute that controls
how far to look back, and-- like other params --this could/should be made
user-overridable at startup and per-file on the fly.
1999-06-01 19:52:34 +00:00
Guido van Rossum 8113cdc3a8 New file by Tim Peters:
One new file in the attached, PyParse.py.  The LineStudier (whatever it was
called <wink>) class was removed from AutoIndent; PyParse subsumes its
functionality.
1999-06-01 19:49:21 +00:00
Guido van Rossum d93f739556 Tim Peters keeps revising this module (more to come):
Removed "New tabwidth" menu binding.

Added "a tab means how many spaces?" dialog to block tabify and untabify.  I
think prompting for this is good now:  they're usually at-most-once-per-file
commands, and IDLE can't let them change tabwidth from the Tk default
anymore, so IDLE can no longer presume to have any idea what a tab means.

Irony:  for the purpose of keeping comments aligned via tabs, Tk's
non-default approach is much nicer than the Emacs/Notepad/Codewright/vi/etc
approach.
1999-06-01 19:47:56 +00:00
Guido van Rossum 198e7cac5a Andy Dustman notes that I patched the close() call in the wrong place.
Here's the correct patch!
1999-06-01 18:58:34 +00:00
Guido van Rossum 6b708d569c In class TemporaryFileWrapper, don't cache attributes of tpye int --
these happen to be 'closed' and 'softspace', which may change!

Noted by Dave Ascher (with slightly different solution).
1999-06-01 18:55:36 +00:00
Guido van Rossum 74311b2c27 1. Catch NameError on import (could be raised by case mismatch on Windows).
2. No longer need to reset pyclbr cache and show watch cursor when calling
   ClassBrowser -- the ClassBrowser takes care of pyclbr and the TreeWidget
   takes care of the watch cursor.
3. Reset the focus to the current window after error message about class
   browser on buffer without filename.
1999-06-01 18:27:14 +00:00
Guido van Rossum 292dd2d1af Missed a few. 1999-06-01 18:23:19 +00:00
Guido van Rossum ec9cca776a Rewritten based on TreeWidget.py 1999-06-01 18:21:31 +00:00
Guido van Rossum 1ff48ec852 Object browser, based on TreeWidget.py. 1999-06-01 18:20:56 +00:00
Guido van Rossum 7419f4b290 Tree widget done right. 1999-06-01 18:19:17 +00:00
Guido van Rossum d3a518b661 As yet unused code for tool tips. 1999-06-01 18:19:02 +00:00
Guido van Rossum ee03611a8d Ensure sys.argv[0] is the script name on Run Script. 1999-06-01 18:18:27 +00:00
Guido van Rossum 96cf271be9 Move zoom height functionality to separate function. 1999-06-01 18:17:02 +00:00
Fred Drake 5fac2ab220 Fix availability clause; mention availability of similar functionality
for Windows using win32pipe.
1999-06-01 17:55:52 +00:00
Guido van Rossum 32465f4148 A few icons used by ../TreeWidget.py and its callers. 1999-06-01 15:04:51 +00:00
Guido van Rossum 8234dfcccb New version by Tim Peters improves block opening test. 1999-06-01 15:03:30 +00:00
Guido van Rossum 116b31bed7 Jack Jansen's patch to support file:///path/file/name URL syntax. 1999-06-01 14:36:56 +00:00
Guido van Rossum fa8c3eab79 Greg McFarlane writes: Tkinter.Text.tag_add should take multiple
arguments.  [Slightly changed from submitted patch.]
1999-06-01 13:57:15 +00:00
Barry Warsaw f63b8cc07c posix_listdir(): When an error occurs, call
posix_error_with_filename() instead of posix_error(), passing in the
name argument, so you get information on which directory was being
listed.
1999-05-27 23:13:21 +00:00
Fred Drake f1882422d2 Oops, forgot to remove the individual module indexes for lib & mac now
that there's a Global Module Index; there can be only one!
1999-05-27 21:56:11 +00:00
Fred Drake 3c27ec2c05 Add <hr> after top navigation bar; now looks more like the rest of the
navigation bars in the HTML output.
1999-05-27 21:52:51 +00:00
Fred Drake d2a727feee Hack: make sure LaTeX2HTML doesn't change -- to - in mkhowto
description.
1999-05-27 21:45:54 +00:00
Fred Drake 3aa70d63b9 Document the "pid" attribute of the Popen3 class.
Use memberdesc instead of datadesc to document object attributes.
This gets the index right.
1999-05-27 17:50:59 +00:00
Fred Drake a7ce52b03a Typo reported by Gerry Wiener <wiener@rap.ucar.edu>:
items -> item

The returned list will then have one more items than the number of
non-overlapping occurrences of the separator in the string.
1999-05-27 17:18:08 +00:00
Fred Drake abc8cc63ce Move some \index entries around so we can avoid using empty comments;
empty comments trigger a bug in LaTeX2HTML.

Problem reported by Gerry Wiener <gerry@ucar.edu>.
1999-05-26 16:15:17 +00:00
Fred Drake 82f355a36a Change the example of configuring for large file support under Solaris
to use `getconf LFS_CFLAGS`.  Steve Clift (the author of the section
and large file support) agrees that this is the right thing to do.
1999-05-26 13:03:34 +00:00
Barry Warsaw a20fdcdd14 Eugene Dvurechenski <jno@glas.net> says:
there is "su" top level domain still maintained in ex-USSR.  at
    least "*.msk.su" zone (Moscow, USSR) is still in use.
1999-05-26 04:02:18 +00:00
Fred Drake 6b330ba857 "proces" --> "process"; reported by Gerry Wiener <gerry@ucar.edu>.
Added some index entries.
1999-05-25 13:42:26 +00:00
Barry Warsaw fa2def2a61 (py-electric-backspace): I'm not sure this function should be special
casing when py-honor-comment-indentation is nil, but this could be a
religious issue with some.  Seems to me we should still be dedenting
such comment lines one level.
1999-05-24 21:43:37 +00:00
Barry Warsaw 53db859408 (py-parse-state): When running under Emacs -- which doesn't have
buffer-syntactic-context -- just short circuit the TQS test by jumping
to point-min and doing the test from there.  For long files, this will
be faster than looping with a re-search-backwards.
1999-05-24 19:57:32 +00:00
Barry Warsaw a8f99ba2d2 (py-statement-closes-block-p): Add a py-goto-initial-line which fixes
indentation when the return value is a multiline sexp:

def bug():
    try:
        if 2>1:
            return (11+
                    12)

        else:   #XXX
            return 12
    except:
        return 13
1999-05-24 18:37:57 +00:00
Just van Rossum c7ba0800dd Oliver Steele writes:
"""Despite the best intentions of Anarchie and Internet Explorer, I often end
up with Python source files (and other text files that I'd like to edit with
PythonIDE) that use '\n' instead of '\r' as a line separator (and therefore
sh
1999-05-21 21:42:27 +00:00
Guido van Rossum 8bfefce75e On HP-UX, -rpath is another option taking an argument that needs to go
to the libs variable.  Reported by Albert Chin-A-Young.
1999-05-21 19:18:49 +00:00
Guido van Rossum 18659608dc Andy Dustman writes:
I noticed while watching (with lsof) my forking SocketServer app running
that I would get multiple processes listening to the socket. For the most
part, this doesn't hurt things, but if you terminate the server, this can
prevent it from restarting because it cannot bind to the port due to any
running children which also have the socket open. The following one-liner
fixes this.
1999-05-21 16:12:30 +00:00
Guido van Rossum b6f8cf123e Rename History to IdleHistory.
Add isatty() to pseudo files.
1999-05-21 04:46:17 +00:00
Guido van Rossum 945507edf6 Make initial stack viewer wider 1999-05-21 04:45:45 +00:00
Guido van Rossum 2092b439be New wishes 1999-05-21 04:45:20 +00:00
Guido van Rossum def2c96718 Much improved autoindent and handling of tabs,
by Tim Peters.
1999-05-21 04:38:27 +00:00
Fred Drake c40c54782c Map .js to application/x-javascript. 1999-05-20 12:52:04 +00:00
Fred Drake 0eb7b2a659 Enhanced docstring and some comments.
_begin_macro_rx:  Fixed RE that didn't properly allow a space after
		  the name of the macro.  This affects the conversion
		  of the tutorial.
1999-05-19 17:37:37 +00:00
Fred Drake c4811d8208 Modify to perform "---" to "&mdash;" conversion outside of
verbatim-like environments.  The list of verbatim-like environments is
a defined by a variable in main().
1999-05-18 17:34:51 +00:00
Fred Drake c41e1e5f5e Remove the "---" to "&mdash;" conversion; this is wrong in verbatim
environments.  Move the conversion to esis2sgml.py.
1999-05-18 17:33:01 +00:00
Fred Drake 338da93734 SET_LINE_NO ==> SET_LINENO
Reported by Corran Webster <cwebster@math.tamu.edu>.
1999-05-17 20:57:07 +00:00