[Patches] [ python-Patches-1201522 ] patch IDLE to allow running anonymous code in editor window

SourceForge.net noreply at sourceforge.net
Sun Oct 2 22:27:22 CEST 2005


Patches item #1201522, was opened at 2005-05-13 13:08
Message generated for change (Comment added) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1201522&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Jeff Shute (jshute)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: patch IDLE to allow running anonymous code in editor window

Initial Comment:
This patch modifies IDLE so that when you can run code
in an editor window that does not have a filename
without first having to save the code.  When you are
editing an existing file, or have already saved the
code once (giving it a filename), you are still
required to save before you can run.

This is useful when using IDLE for interactive hacking
or calculating.  Having to save and choose a filename
is annoying when typing and running code that you have
no intention of keeping, and tends to encourage editing
big blocks of code in the shell when using an editor
window would really be more convenient.

I think the only reason that the save is required is
because the debugger was getting confused when it did
not have a backing file with the code.  This patch
fixes the debugger so it can handle unsaved anonymous
code, and can highlight the correct source line in the
edit window when the show source box is checked.  The
enhancement also works for the shell window, so the
debugger can highlight the source line in the shell
window (which may be something other than the last
command, eg a function definition).  The stack viewer
and goto line command are also fixed to handle unsaved
edit windows and the shell.

It probably makes sense to apply this trivial patch
also so you can get syntax highlighting in unsaved
editor windows.
http://sourceforge.net/tracker/index.php?func=detail&aid=1196895&group_id=5470&atid=305470

----------------------------------------------------------------------

>Comment By: Kurt B. Kaiser (kbk)
Date: 2005-10-02 16:27

Message:
Logged In: YES 
user_id=149084

Having thought about this for awhile, I've concluded that the patch raises
the risk of unintentionally losing code that one thought was being
autosaved.  It's simple enough to generate a throwaway filename, perhaps
today's date, and clean the old ones out once in a while.  Or reuse a file
named scratch.py: pick it from the Recent Files menu, hit Select All followed
by Backspace.  The benefit/risk tradeoff just isn't good enough.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1201522&group_id=5470


More information about the Patches mailing list