#7915: Improve TAB-completion in Macaulay2
--------------------------+-------------------------------------------------
Reporter: novoselt | Owner: was
Type: defect | Status: new
Priority: major | Milestone:
Component: interfaces | Keywords: Macaulay2, interface, TAB-completion
Work_issues: | Author: Andrey Novoseltsev
Upstream: N/A | Reviewer:
Merged: |
--------------------------+-------------------------------------------------
There are the following problems with the current TAB-completion in
Macaulay2:
* it is slow and there is a special function which creates the list of
commands and stores it in file for future use;
* this function prints a message which is not visible in the notebook and
it looks like the notebook stopped responding;
* new objects defined by user or introduced by loaded packages do not
appear in this static list;
* TAB-completion for Macaulay2 objects shows the same list of more than
1000 names as for Macaulay2 sessions, most of the stuff in this list
cannot be applied to the given object.
The attached patch changes trait_names functions so that
* functions for building command lists execute reasonably fast for
interaction (0.2-0.6 second on my machine);
* both lists for an interpreter session and for objects in it are
computed dynamically on each call and take into account loaded and created
names;
* only methods which can take an object as the first argument are shown
for objects;
* execution time for "sage -t --optional macaulay2.py" dropped from 3
minutes (which was really annoying me for the last 5 days) to 30 seconds.
New problem (doesn't need much attention, I think):
* shortcuts like "gens" for "generators" are not displayed in both lists
because of the way they are defined in Macaulay2, this is likely to be
fixed in the next release (of Macaulay2).
Remaining problem (to be addressed later):
* Macaulay2 convention is to put "the important argument" last, so a
useful function "f" will not be displayed in TAB-completion for "x" if it
should be called like "f(7, x)" in Macaulay2. Since the default call
corresponding to Sage command "x.f(7)" is "f(x, 7)", this is actually
correct and "f" should not be listed. However, it may be useful to have an
option to translate all calls of the form "x.f(...)" in Sage to "f(...,
x)" in Macaulay2.
Patches from #7897 are a prerequisite for this one.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7915>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.