sagemath / sage-shell-mode

Emacs front end for SageMath
GNU General Public License v3.0
102 stars 16 forks source link

auto complete on from sage.<TAB> #2

Closed malb closed 9 years ago

malb commented 9 years ago

I often find myself typing "from sage.rings.all import P…" or so and it would be awesome if sage-shell-mode could offer me some auto-completion options for that.

(One option to realise this feature could be to use jedi-mode, but it's not like I understand the emacs+python eco-system well enough to judge)

stakemori commented 9 years ago

I think it is not so hard to implement such a feature. I will probably implement it when I have enough time.

stakemori commented 9 years ago

In recent commits, I implemented this feature. Please update sage-shell-mode and auto-complete-sage to the latest version.

I added a new customizable variable ac-sage-complete-on-dot. This is similar to jedi:complete-on-dot in jedi-core.el. When it is non-nil, auto-complete starts when a dot is inserted.

If you are using the ac-source provided by jedi, please call jedi:setup before calling ac-sage-setup. Then the ac-source provided by jedi is preferred.