Opened 9 years ago

Last modified 5 years ago

#7586 new enhancement

developers' guide: document features of attach, load, iload, ed, %ed, %edit, edit()

Reported by: mvngu Owned by: mvngu
Priority: minor Milestone: sage-6.4
Component: documentation Keywords:
Cc: jhpalmieri Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mvngu)

From this sage-devel thread:

By the way, I discovered accidentally that from the command line (not
the notebook) if you type:

sage: ed   # or %ed or %edit

then it opens up your favorite editor (whatever is set by the $EDITOR
shell variable).  Then in the editor you can type

def FF(x):
    long definition here
    which would be really annoying
    to type on the command line

then save it -- it gets written to a temporary file -- and the code
gets executed and you have thus redefined FF.  Then later you can do

sage: ed FF

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

The following commands should at least be documented in the Developers' Guide together with explanation on how to use them for interactive development:

  1. load --- see sage.misc.interpreter
  2. attach --- see sage.misc.interpreter
  3. iload --- see sage.misc.interpreter
  4. ed
  5. %ed
  6. %edit --- see the IPython manual
  7. edit() --- see sage.misc.edit_module.edit

Change History (10)

comment:1 Changed 9 years ago by mvngu

  • Summary changed from develoers' guide: document features of attach, load, iload, ed, %ed, %edit, edit() to developers' guide: document features of attach, load, iload, ed, %ed, %edit, edit()

comment:2 Changed 9 years ago by ddrake

Some of those commands -- the % ones -- come from IPython, right? If so, we should find where their documentation is online and link to that, along with some brief descriptions of useful commands. One that I like is !clear which simply clears the screen.

comment:3 Changed 9 years ago by mvngu

  • Description modified (diff)

comment:4 Changed 9 years ago by jhpalmieri

  • Cc jhpalmieri added

comment:5 Changed 9 years ago by mpatel

Just a quick, somewhat-related note: attach and load have been rewritten at #7514.

comment:6 Changed 8 years ago by jhpalmieri

See #11219 for a related ticket. (I thought that "%edit" was useful enough for general users that it should be in the tutorial, not just the developer's guide.)

comment:7 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:8 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:9 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:10 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.