6

My elpy uses ipython as the interactive interpreter. It does not, however, emulate ipython's history-informed autocomplete feature (for lack of a better term).

That is: within an ipython session launched from the terminal, if you want to execute a line previously executed, you can type the first part of the line, and up-arrow will only display consistent previous commands.

In the ipython shell launched from elpy (with C-c C-c), I can execute previous commands with C-p, but I cannot view only those commands consistent with a given partial command. How can I utilize this very useful feature of ipython within the emacs elpy shell?

1
  • Try M-x comint-previous-matching-input.
    – wasamasa
    Commented Feb 24, 2017 at 21:48

1 Answer 1

6

I don't use eply, I use emacs 25.1.1 with company-jedi with the following:

(setq
 python-shell-interpreter "ipython3"
 python-shell-interpreter-args "--simple-prompt --pprint")

Inside emacs *Python*

Python 3.6.0, Anaconda 4.3.0, Ipython 5.1.0

In[1]: x = 10
In[2]: x = 125
In[3]: x =      # type M-p 

I get history items 1 and 2 and Input restored. That example seems to be working for me.

Please share what your emacs version, (I)python version and a code snippet. It may be useful to file a bug report with elpy if that is the problem.

1
  • Yes, this works. Even with elpy. If you start a command and press M-p it completes it. However, in the normal IPython shell, commands from previous sessions can be accessed in the same way. In my emacs setup, this doesn't seem possible.
    – user989762
    Commented Jul 19, 2018 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.