<div class="gmail_quote">On Thu, May 26, 2011 at 4:04 PM, Fernando Perez <span dir="ltr"><<a href="http://fperez.net">fperez.net</a>@<a href="http://gmail.com">gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, May 26, 2011 at 5:56 AM, Thomas Kluyver <<a href="mailto:takowl@gmail.com">takowl@gmail.com</a>> wrote:<br>
> In the Qt console, calling %edit will normally open the target in a GUI<br>
> editor.* Editors that can open multiple documents may not block the call,<br>
> although apparently some of them have command-line flags for that behaviour.<br>
> So as it stands, %edit in the Qt console will show you a file you can change<br>
> and save, but won't take any further action on it. Then again, since the Qt<br>
> console has decent editing capabilities itself, you can use the %recall and<br>
> %loadpy macros to bring code to the next prompt, and edit it there before<br>
> running it.<br>
<br>
</div>It seems to me that %edit should, in the gui console, by default use<br>
the -x flag always.  This way it's useful as a mechanism to quickly<br>
load the thing you want to work on, but you're still responsible for<br>
saving and doing %run yourself.<br>
<br>
That doesn't bother me too much, because I think that with the<br>
multiline capabilities of the Qt console, many of the use cases of<br>
%edit are now subsumed by simply recalling a previous cell with<br>
up-arrow and editing it right there.  And once the amount of code in<br>
the cell becomes large, it's probably best to just keep a persistent<br>
editor open using the classic 'save, alt-tab, run' cycle.<br>
<div class="im"><br>
> We should also consider how we will want %edit to work in other situations,<br>
> including the HTML notebook which is being prepared, and IPython as an<br>
> embedded widget in other software.<br>
<br>
</div>Applications that embed the console can always override %edit to<br>
synchronize with their own mechanisms; Evan, does that sound<br>
reasonable for your use cases?<br>
<br>
As for the html notebook, it would be really cool if edit would open<br>
the file in-browser, either using a full-tab Codemirror cell or<br>
something like ymacs (<a href="http://www.ymacs.org/" target="_blank">http://www.ymacs.org/</a>).  But the architectural<br>
decisions for magics with client-specific behavior are a bit tricky,<br>
since all code is actually executed in-kernel, and the same kernel can<br>
be simultaneously serving more than one client...<br>
<br></blockquote><div><br>Yep, as long as %edit is still programmatically over-ridable, it's all good to me.<br><br>BTW, the link to ymacs was neat. I had no idea there was such a thing.<br><br>Evan<br></div></div>