Hi John,

On Thu, Dec 3, 2009 at 6:47 AM, John H Palmieri <jhpalmier...@gmail.com> wrote:

<SNIP>

> By the way, I discovered accidentally that from the command line (not
> the notebook) if you type:
>
> sage: ed   # or %ed or %edit

That is so cool! And very useful, too! What a serendipitous discovery!


> and it will let you modify your code.  This is an ipython feature, it
> seems.  Should it be described somewhere in the Sage documentation?

That feature deserves some documentation at least in the Developers'
Guide. This is now ticket #7586 [1]. Users and developers, at least
myself, often work with the Sage command line to develop code or
modify existing source files. My typical work flow involves having two
terminal windows: one to show the Sage command line session; another
to show a terminal Emacs session. I would use the command "load"
and/or "attach" to (automatically) load the modified source file so
that I could experiment with the new code.

Of course, there's also the command "iload" to interactively load a
file. When using "iload", one has to repeatedly press Enter in order
to load the next line in a source file. But the good thing is that for
every line loaded with "iload", if the line produces some output then
the output is printed as well. One could think of "iload" sort of like
individually entering every line at the Sage command line interface.
As an aside, there's also the function "edit()" in the Sage library.

And now you report about "ed", "%ed" and "%edit" to do a similar thing
as described above, but without having to open two terminal windows.
Plus, after one is done editing a file, closing the editor would also
trigger an automatic reloading of the modified file. That is just
awesome to have and I'm grateful to the IPython developers for this
nifty feature.

[1] http://trac.sagemath.org/sage_trac/ticket/7586

-- 
Regards
Minh Van Nguyen

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to