This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: patch IDLE to allow running anonymous code in editor window
Type: Stage:
Components: IDLE Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: kbk Nosy List: jshute, kbk
Priority: normal Keywords: patch

Created on 2005-05-13 17:08 by jshute, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
runnableeditwindow.patch jshute, 2005-05-13 17:09 patch
Messages (2)
msg48340 - (view) Author: Jeff Shute (jshute) Date: 2005-05-13 17:08
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
msg48341 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2005-10-02 20:27
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.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41981
2005-05-13 17:08:59jshutecreate