Rework when IDLE opens editor and/or shell windows

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Rework when IDLE opens editor and/or shell windows

Tal Einat
I'd like to hear some comments on my thinking regarding this.

I started thinking about this thanks to
http://bugs.python.org/issue6698. Here is my last comment on that
issue:

After looking through the code and experimenting a bit, I propose the following:

The "editor-on-startup" config option should be removed. Running IDLE
without arguments should open a shell. If IDLE is asked to open any
files for editing, it should open just editor windows. IDLE should
open both a shell window and one or more editor windows only when
explicitly asked to do so on the command line.

If this is done, the -e option ("open an editor") would tell IDLE to
open an empty editor window if no files are asked to be opened for
editing. If no other arguments are given, IDLE will open just an
editor window (no shell window). The -i option ("open a shell") would
tell IDLE to open a shell window even if asked to open files for
editing.

I think this is more obvious and easier to work with. It will also
make the command line argument processing code simpler. And as a bonus
we remove a config option :)

Thoughts? Comments? If there is agreement I will work up a patch.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Bruce Sherwood-3
If you're speaking solely about running IDLE from a command line I
don't care what the situation is. But it is extremely important to me
that my students (and I) be able to start IDLE in such a way that what
one sees is a blank edit window and no shell window, on all platforms
(Windows, Mac, Linux). If there is some way to continue to be able to
do this, by means of how the script/shortcut is set up, fine. But you
seem to be proposing that this behavior would in the future be
eliminated, which is not acceptable.

Bruce Sherwood

On Wed, Jul 21, 2010 at 4:08 AM, Tal Einat <[hidden email]> wrote:

> I'd like to hear some comments on my thinking regarding this.
>
> I started thinking about this thanks to
> http://bugs.python.org/issue6698. Here is my last comment on that
> issue:
>
> After looking through the code and experimenting a bit, I propose the following:
>
> The "editor-on-startup" config option should be removed. Running IDLE
> without arguments should open a shell. If IDLE is asked to open any
> files for editing, it should open just editor windows. IDLE should
> open both a shell window and one or more editor windows only when
> explicitly asked to do so on the command line.
>
> If this is done, the -e option ("open an editor") would tell IDLE to
> open an empty editor window if no files are asked to be opened for
> editing. If no other arguments are given, IDLE will open just an
> editor window (no shell window). The -i option ("open a shell") would
> tell IDLE to open a shell window even if asked to open files for
> editing.
>
> I think this is more obvious and easier to work with. It will also
> make the command line argument processing code simpler. And as a bonus
> we remove a config option :)
>
> Thoughts? Comments? If there is agreement I will work up a patch.
> _______________________________________________
> IDLE-dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/idle-dev
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Kevin Walzer-5
In reply to this post by Tal Einat
On 7/21/10 6:08 AM, Tal Einat wrote:

>
> The "editor-on-startup" config option should be removed. Running IDLE
> without arguments should open a shell. If IDLE is asked to open any
> files for editing, it should open just editor windows. IDLE should
> open both a shell window and one or more editor windows only when
> explicitly asked to do so on the command line.
>
> If this is done, the -e option ("open an editor") would tell IDLE to
> open an empty editor window if no files are asked to be opened for
> editing. If no other arguments are given, IDLE will open just an
> editor window (no shell window). The -i option ("open a shell") would
> tell IDLE to open a shell window even if asked to open files for
> editing.
>
> I think this is more obvious and easier to work with. It will also
> make the command line argument processing code simpler. And as a bonus
> we remove a config option :)

I'm not sure if I agree with this or not, but it appears to me that this
proposal is mostly relevant for X11-based systems. On the Mac I open
IDLE by double-clicking its app icon, not from the terminal; it appears
that IDLE opens a shell by default in this context and opens both the
shell and any files that are dropped on the app icon. I'm also not sure
how IDLE works on Windows in this regard. Comments?

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Guilherme Polo
2010/7/21 Kevin Walzer <[hidden email]>:

> On 7/21/10 6:08 AM, Tal Einat wrote:
>>
>> The "editor-on-startup" config option should be removed. Running IDLE
>> without arguments should open a shell. If IDLE is asked to open any
>> files for editing, it should open just editor windows. IDLE should
>> open both a shell window and one or more editor windows only when
>> explicitly asked to do so on the command line.
>>
>> If this is done, the -e option ("open an editor") would tell IDLE to
>> open an empty editor window if no files are asked to be opened for
>> editing. If no other arguments are given, IDLE will open just an
>> editor window (no shell window). The -i option ("open a shell") would
>> tell IDLE to open a shell window even if asked to open files for
>> editing.
>>
>> I think this is more obvious and easier to work with. It will also
>> make the command line argument processing code simpler. And as a bonus
>> we remove a config option :)
>
> I'm not sure if I agree with this or not, but it appears to me that this
> proposal is mostly relevant for X11-based systems. On the Mac I open IDLE by
> double-clicking its app icon, not from the terminal; it appears that IDLE
> opens a shell by default in this context and opens both the shell and any
> files that are dropped on the app icon. I'm also not sure how IDLE works on
> Windows in this regard. Comments?
>

It is important to read the first message on the issue mentioned earlier.


--
-- Guilherme H. Polo Goncalves
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Weeble
In reply to this post by Tal Einat
On Wed, Jul 21, 2010 at 11:08 AM, Tal Einat <[hidden email]> wrote:
> Thoughts? Comments? If there is agreement I will work up a patch.

Personally, I would slightly prefer that the default behaviour on
starting IDLE via the shortcut in the start menu is to open a blank
document and no shell window. I think of IDLE first and foremost as an
editor, and I prefer it to behave like other editors that start up
with a blank document. But this may be better dealt with by tweaking
the shortcuts/launchers created by the installer.

PS - I see my name mentioned in the log of revision 71126. I'm pretty
sure the changes to enable_shell were not part of my original patch.
Perhaps Kurt included them entirely by accident? I'm not sure whether
they're related to the sub-process problem.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Bruce Sherwood-3
In reply to this post by Tal Einat
I agree completely with Weeble but can continue to live with starting
as an editor being a configuration parameter (VIDLE in fact ships with
this set to "start in editor").

Note that if you're starting from a command line, you already have a
(primitive) shell available: just start Python instead of IDLE.

Bruce Sherwood

On Wed, Jul 21, 2010 at 11:59 AM, Weeble <[hidden email]> wrote:
> On Wed, Jul 21, 2010 at 11:08 AM, Tal Einat <[hidden email]> wrote:
>> Thoughts? Comments? If there is agreement I will work up a patch.
>
> Personally, I would slightly prefer that the default behaviour on
> starting IDLE via the shortcut in the start menu is to open a blank
> document and no shell window. I think of IDLE first and foremost as an
> editor, and I prefer it to behave like other editors that start up
> with a blank document. But this may be better dealt with by tweaking
> the shortcuts/launchers created by the installer.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Tal Einat
On Wed, Jul 21, 2010 at 9:54 PM, Bruce Sherwood wrote:

> On Wed, Jul 21, 2010 at 11:59 AM, Weeble wrote:
>> On Wed, Jul 21, 2010 at 11:08 AM, Tal Einat wrote:
>>> Thoughts? Comments? If there is agreement I will work up a patch.
>>
>> Personally, I would slightly prefer that the default behaviour on
>> starting IDLE via the shortcut in the start menu is to open a blank
>> document and no shell window. I think of IDLE first and foremost as an
>> editor, and I prefer it to behave like other editors that start up
>> with a blank document. But this may be better dealt with by tweaking
>> the shortcuts/launchers created by the installer.
>
> I agree completely with Weeble but can continue to live with starting
> as an editor being a configuration parameter (VIDLE in fact ships with
> this set to "start in editor").
>
> Note that if you're starting from a command line, you already have a
> (primitive) shell available: just start Python instead of IDLE.
>
> Bruce Sherwood

Ok, it seems several people want to keep the config option to have
IDLE open with an empty editor window instead of a shell window by
default. How about we make it so that this config option only affects
what IDLE does when run without any other arguments, such as via
IDLE.app? In any other case, I think IDLE should ignore the
"start-with-editor" config option.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Weeble
On Wed, Jul 21, 2010 at 8:22 PM, Tal Einat <[hidden email]> wrote:
> Ok, it seems several people want to keep the config option to have
> IDLE open with an empty editor window instead of a shell window by
> default. How about we make it so that this config option only affects
> what IDLE does when run without any other arguments, such as via
> IDLE.app? In any other case, I think IDLE should ignore the
> "start-with-editor" config option.

I think that makes sense. The command-line should always be able to
override the config option.
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Bruce Sherwood-3
Agreed. As I indicated earlier, I don't care what happens from a
command line, since unskilled users of Python and IDLE are very
unlikely to start from a command line, and power users should have
full flexibility.

Bruce Sherwood

On Wed, Jul 21, 2010 at 1:59 PM, Weeble <[hidden email]> wrote:

> On Wed, Jul 21, 2010 at 8:22 PM, Tal Einat <[hidden email]> wrote:
>> Ok, it seems several people want to keep the config option to have
>> IDLE open with an empty editor window instead of a shell window by
>> default. How about we make it so that this config option only affects
>> what IDLE does when run without any other arguments, such as via
>> IDLE.app? In any other case, I think IDLE should ignore the
>> "start-with-editor" config option.
>
> I think that makes sense. The command-line should always be able to
> override the config option.
>
_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Terry Reedy
In reply to this post by Kevin Walzer-5
On 7/21/2010 10:58 AM, Kevin Walzer wrote:
> I'm also not sure how IDLE works on Windows in this regard. Comments?

WinXP, Py3.1, Start Menu/Programs/Python3.1/ shortcuts

The IDLE and Interpreter shortcuts are not 'normal'. On the Shortcut tab
of the Properties dialog, the Target location: field is blank and the
Target: field is a grayed-out, uneditable and useless 'Python 3.1.2'.
And this is as admin user.

By comparison, a Windows Media Player shortcut says T location: Windows
Media Player (read-only, should be called Target name:). Target: has
"C:path/to/WMP/wmplayer.exe" /prefetch 1 in an editable box. So whatever
/prefetch 1 means, I could change it.

The Python shortcuts seems possibly buggy to me, but the point is that
command line args are currently useless without informing users how to
create a proper, editable shortcut where one could use them.

I do not care at the moment because I always want a shell window and can
easily open a edit window. The only reason not to open a shell that I
can see is if one is editing non-Python files.

--
Terry Jan Reedy

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev
Reply | Threaded
Open this post in threaded view
|

Re: Rework when IDLE opens editor and/or shell windows

Beni Cherniavsky-Paskin
In reply to this post by Bruce Sherwood-3
[Forgot to cc: the rest of the list.]

On Wed, Jul 21, 2010 at 14:37, Beni Cherniavsky-Paskin <[hidden email]> wrote:
On Wed, Jul 21, 2010 at 23:09, Bruce Sherwood <[hidden email]> wrote:
Agreed. As I indicated earlier, I don't care what happens from a
command line, since unskilled users of Python and IDLE are very
unlikely to start from a command line, and power users should have
full flexibility.

Bruce Sherwood

Note that this also affects the behaviour of dragging files to the
IDLE icon, and possibly right click → Edit with IDLE.
Tal's proposal would change that from open-files-and-shell to
open-files only.
+1 (less distracting IMHO and a shell is always a menu/F5 away)
 
<wrong> 
BTW, "Edit with IDLE" on windows opens IDLE in lame no-subshell mode.
I believe that is a vestige of IDLE using a single port.  Can we please drop it?
Currently I'm forced to tell students to avoid "Edit with IDLE" and always
do File→Open.
</wrong>
Turns out this was already fixed in 2.7 and 3.1 (issue5847).

Better yet, would it be easy to arrange something like emacsclient:
if an IDLE is already running, ask it to open the files instead of
opening a new IDLE instance.
Sounds to me a lot of work to implement & debug.
Clever ideas anybody?

Generally running more than one IDLE is a recipe for confusion.
- A tabbed interface would make this situation much clearer!
- Would adding numbers to the title - e.g. "IDLE (3)" - help?
  These can be inferred from the port we manage to grab;
  but we'll have to grab a port early even when not opening a shell.


--
Beni Cherniavsky-Paskin <[hidden email]>

_______________________________________________
IDLE-dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/idle-dev