[Tab] complete in Ipython after update

Bug #1425268 reported by Justin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

Hello,

I jsut pulled the latest python-mode.el and also recently upgrade my ipython to 2.4. I now have two issues
with tab complete in emacs. All of this is with no customizations in python-mode.

1) In the Ipython shell, autocomplete moves the cursor to the next line. For example, when typiing

[1] imp[tab]

the imp is completed to import but the cursor then moves to the next line.

2) I am getting a weird complete for some functions. For example if I do

[2] np.asar[tab]

I would expect to see a selection of completion possibilities. Instead [tab] just completes to

[2] np.asarray_chkfinite

which is only one of many possible completions.

Thanks for any help you may be able to offer,

Justin

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1425268] [NEW] [Tab] complete in Ipython after update

On 24.02.2015 21:25, Justin wrote:
> Public bug reported:
>
> Hello,
>
> I jsut pulled the latest python-mode.el and also recently upgrade my ipython to 2.4. I now have two issues
> with tab complete in emacs. All of this is with no customizations in python-mode.
>
> 1) In the Ipython shell, autocomplete moves the cursor to the next line.
> For example, when typiing
>
> [1] imp[tab]
>
> the imp is completed to import but the cursor then moves to the next
> line.
>

See it, thanks reporting.

> 2) I am getting a weird complete for some functions. For example if I
> do
>
> [2] np.asar[tab]
>
> I would expect to see a selection of completion possibilities. Instead
> [tab] just completes to
>
> [2] np.asarray_chkfinite
>
> which is only one of many possible completions.
>

Will look for it.

Andreas

Revision history for this message
Justin (justin-grana) wrote :

Thank you for the reply. Please let me know if you need any other info
on my end.
On 02/24/2015 01:03 PM, Andreas Roehler wrote:
> On 24.02.2015 21:25, Justin wrote:
>> Public bug reported:
>>
>> Hello,
>>
>> I jsut pulled the latest python-mode.el and also recently upgrade my ipython to 2.4. I now have two issues
>> with tab complete in emacs. All of this is with no customizations in python-mode.
>>
>> 1) In the Ipython shell, autocomplete moves the cursor to the next line.
>> For example, when typiing
>>
>> [1] imp[tab]
>>
>> the imp is completed to import but the cursor then moves to the next
>> line.
>>
> See it, thanks reporting.
>
>> 2) I am getting a weird complete for some functions. For example if I
>> do
>>
>> [2] np.asar[tab]
>>
>> I would expect to see a selection of completion possibilities. Instead
>> [tab] just completes to
>>
>> [2] np.asarray_chkfinite
>>
>> which is only one of many possible completions.
>>
> Will look for it.
>
> Andreas
>

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Please open if not done. BTW in that case you could run ert-test py-ert-socket-modul-completion-lp-1284141 from file test/py-ert-tests-1.el and report the result.

Changed in python-mode:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.2.1
Revision history for this message
Justin (justin-grana) wrote :

The first issue is fixed (I probably should have filed two separate bug reports (and can still do so if tha tis convenient)) but the second issue remains. However, it is very strange. To elaborate, if I do

[1] np.asa[TAB]

np.asarray is a possible completion

However, if I do

[2] np.asar[TAB]

it automaticaly compeletes to np.asarray_chkfinite

Furthermore, this seems to be the only function where I see this strange behavior.

I **think** I ran the test but list is pretty foreign to me so if I didn't do it correctly, please
let me know. Otherwise, here are the results:

Selector: py-ert-socket-modul-completion-lp-1284141
Passed: 0
Failed: 1 (1 unexpected)
Total: 1/1

Started at: 2015-02-26 09:17:13-0800
Finished.
Finished at: 2015-02-26 09:17:13-0800

 py-ert-socket-modul-completion-lp-1284141
    (void-function py-test-with-temp-buffer)Selector: py-ert-socket-modul-completion-lp-1284141
Passed: 0
Failed: 1 (1 unexpected)
Total: 1/1

Started at: 2015-02-26 09:17:13-0800
Finished.
Finished at: 2015-02-26 09:17:13-0800

py-ert-socket-modul-completion-lp-1284141
    (void-function py-test-with-temp-buffer)

Changed in python-mode:
status: Fix Committed → In Progress
Revision history for this message
Justin (justin-grana) wrote :

One more quick edit:

If I do

[1] np.arr[TAB]

it completes to np.array but np.array is not listed as a possible completion.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1425268] Re: [Tab] complete in Ipython after update

On 26.02.2015 18:28, Justin wrote:
> The first issue is fixed (I probably should have filed two separate bug
> reports (and can still do so if tha tis convenient)) but the second
> issue remains. However, it is very strange. To elaborate, if I do
>
> [1] np.asa[TAB]
>
> np.asarray is a possible completion
>
> However, if I do
>
> [2] np.asar[TAB]
>
> it automaticaly compeletes to np.asarray_chkfinite
>
> Furthermore, this seems to be the only function where I see this strange
> behavior.
>
> I **think** I ran the test but list is pretty foreign to me so if I didn't do it correctly, please
> let me know. Otherwise, here are the results:
>
> Selector: py-ert-socket-modul-completion-lp-1284141
> Passed: 0
> Failed: 1 (1 unexpected)
> Total: 1/1
>
> Started at: 2015-02-26 09:17:13-0800
> Finished.
> Finished at: 2015-02-26 09:17:13-0800
>
>
> py-ert-socket-modul-completion-lp-1284141
> (void-function py-test-with-temp-buffer)Selector: py-ert-socket-modul-completion-lp-1284141
> Passed: 0
> Failed: 1 (1 unexpected)
> Total: 1/1
>
> Started at: 2015-02-26 09:17:13-0800
> Finished.
> Finished at: 2015-02-26 09:17:13-0800
>
>
> py-ert-socket-modul-completion-lp-1284141
> (void-function py-test-with-temp-buffer)
>

Defined at top of the file.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

On 26.02.2015 18:31, Justin wrote:
> One more quick edit:
>
> If I do
>
> [1] np.arr[TAB]
>
> it completes to np.array but np.array is not listed as a possible
> completion.
>

Result seems resonable for me - see attachment.

Revision history for this message
Justin (justin-grana) wrote :

Ok, I think I got it this time:

Test py-ert-socket-modul-completion-lp-1284141 backtrace:
   (py-indent-or-complete)
   (let ((py-debug-p t) (py-shell-name "python") oldbuf) (if py-debug-p
   (let (hs-minor-mode) (python-mode) (insert "import socket\nsocket.")
   (progn (let (hs-minor-mode) (python-mode) (insert "import socket\nso
   (unwind-protect (progn (let (hs-minor-mode) (python-mode) (insert "i
   (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
   (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b
   (lambda nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa
   byte-code("\306\307!q\210\310\216\311 \312\216\313\314\315\316\3
   ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
   byte-code("\306\307!\211\211r\310\311!q\210\312 d\313\223)L\210)\3
   ert-run-test([cl-struct-ert-test py-ert-socket-modul-completion-lp-1
   ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test p
   ert-run-tests(t #[(event-type &rest event-args) "\30\307\"\203G \
   ert-run-tests-batch(nil)
   ert-run-tests-batch-and-exit()
   command-line-1(("-l" "ert" "-l" "py-ert-tests-1.el" "-f" "ert-run-te
   command-line()
   normal-top-level()
Test py-ert-socket-modul-completion-lp-1284141 condition:
     (void-function py-indent-or-complete)
    FAILED 27/29 py-ert-socket-modul-completion-lp-1284141
Can't guess python-indent-offset, using defaults: 4

On 02/26/2015 10:21 AM, Andreas Roehler wrote:
> On 26.02.2015 18:28, Justin wrote:
>> The first issue is fixed (I probably should have filed two separate bug
>> reports (and can still do so if tha tis convenient)) but the second
>> issue remains. However, it is very strange. To elaborate, if I do
>>
>> [1] np.asa[TAB]
>>
>> np.asarray is a possible completion
>>
>> However, if I do
>>
>> [2] np.asar[TAB]
>>
>> it automaticaly compeletes to np.asarray_chkfinite
>>
>> Furthermore, this seems to be the only function where I see this strange
>> behavior.
>>
>> I **think** I ran the test but list is pretty foreign to me so if I didn't do it correctly, please
>> let me know. Otherwise, here are the results:
>>
>> Selector: py-ert-socket-modul-completion-lp-1284141
>> Passed: 0
>> Failed: 1 (1 unexpected)
>> Total: 1/1
>>
>> Started at: 2015-02-26 09:17:13-0800
>> Finished.
>> Finished at: 2015-02-26 09:17:13-0800
>>
>>
>> py-ert-socket-modul-completion-lp-1284141
>> (void-function py-test-with-temp-buffer)Selector: py-ert-socket-modul-completion-lp-1284141
>> Passed: 0
>> Failed: 1 (1 unexpected)
>> Total: 1/1
>>
>> Started at: 2015-02-26 09:17:13-0800
>> Finished.
>> Finished at: 2015-02-26 09:17:13-0800
>>
>>
>> py-ert-socket-modul-completion-lp-1284141
>> (void-function py-test-with-temp-buffer)
>>
> Defined at top of the file.
>

Revision history for this message
Justin (justin-grana) wrote :

Yes, that is what I get too. It is slightly different from the standard
ipython completion
because the ipython completion will also list np.array as a possible
completion, even when
np.array is already completed.

I guess that is not a bug but more of just different functionality.
On 02/26/2015 10:36 AM, Andreas Roehler wrote:
> On 26.02.2015 18:31, Justin wrote:
>> One more quick edit:
>>
>> If I do
>>
>> [1] np.arr[TAB]
>>
>> it completes to np.array but np.array is not listed as a possible
>> completion.
>>
> Result seems resonable for me - see attachment.
>
>
> ** Attachment added: "arr.png"
> https://bugs.launchpad.net/bugs/1425268/+attachment/4328643/+files/arr.png
>

Revision history for this message
Andreas Roehler (a-roehler) wrote :

On 26.02.2015 19:43, Justin wrote:
> Ok, I think I got it this time:
>
> Test py-ert-socket-modul-completion-lp-1284141 backtrace:
> (py-indent-or-complete)
> (let ((py-debug-p t) (py-shell-name "python") oldbuf) (if py-debug-p
> (let (hs-minor-mode) (python-mode) (insert "import socket\nsocket.")
> (progn (let (hs-minor-mode) (python-mode) (insert "import socket\nso
> (unwind-protect (progn (let (hs-minor-mode) (python-mode) (insert "i
> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
> (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b
> (lambda nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa
> byte-code("\306\307!q\210\310\216\311 \312\216\313\314\315\316\3
> ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
> byte-code("\306\307!\211\211r\310\311!q\210\312 d\313\223)L\210)\3
> ert-run-test([cl-struct-ert-test py-ert-socket-modul-completion-lp-1
> ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test p
> ert-run-tests(t #[(event-type &rest event-args) "\30\307\"\203G \
> ert-run-tests-batch(nil)
> ert-run-tests-batch-and-exit()
> command-line-1(("-l" "ert" "-l" "py-ert-tests-1.el" "-f" "ert-run-te
> command-line()
> normal-top-level()
> Test py-ert-socket-modul-completion-lp-1284141 condition:
> (void-function py-indent-or-complete)
> FAILED 27/29 py-ert-socket-modul-completion-lp-1284141
> Can't guess python-indent-offset, using defaults: 4

Seems python-mode.el wasn't loaded. python-indent-offset is from python.el

Revision history for this message
Justin (justin-grana) wrote :

I ran this from command line. Should I run it a different way?

emacs -batch -l ert -l py-ert-tests-1.el -f ert-run-tests-batch-and-exit

On 02/26/2015 11:00 AM, Andreas Roehler wrote:
> On 26.02.2015 19:43, Justin wrote:
>> Ok, I think I got it this time:
>>
>> Test py-ert-socket-modul-completion-lp-1284141 backtrace:
>> (py-indent-or-complete)
>> (let ((py-debug-p t) (py-shell-name "python") oldbuf) (if py-debug-p
>> (let (hs-minor-mode) (python-mode) (insert "import socket\nsocket.")
>> (progn (let (hs-minor-mode) (python-mode) (insert "import socket\nso
>> (unwind-protect (progn (let (hs-minor-mode) (python-mode) (insert "i
>> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
>> (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b
>> (lambda nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa
>> byte-code("\306\307!q\210\310\216\311 \312\216\313\314\315\316\3
>> ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
>> byte-code("\306\307!\211\211r\310\311!q\210\312 d\313\223)L\210)\3
>> ert-run-test([cl-struct-ert-test py-ert-socket-modul-completion-lp-1
>> ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test p
>> ert-run-tests(t #[(event-type &rest event-args) "\30\307\"\203G \
>> ert-run-tests-batch(nil)
>> ert-run-tests-batch-and-exit()
>> command-line-1(("-l" "ert" "-l" "py-ert-tests-1.el" "-f" "ert-run-te
>> command-line()
>> normal-top-level()
>> Test py-ert-socket-modul-completion-lp-1284141 condition:
>> (void-function py-indent-or-complete)
>> FAILED 27/29 py-ert-socket-modul-completion-lp-1284141
>> Can't guess python-indent-offset, using defaults: 4
> Seems python-mode.el wasn't loaded. python-indent-offset is from
> python.el
>

Revision history for this message
Andreas Roehler (a-roehler) wrote :

On 26.02.2015 19:48, Justin wrote:
> Yes, that is what I get too. It is slightly different from the standard
> ipython completion
> because the ipython completion will also list np.array as a possible
> completion, even when
> np.array is already completed.
>
> I guess that is not a bug but more of just different functionality.

So please close again.

Justin (justin-grana)
Changed in python-mode:
status: In Progress → Fix Committed
Revision history for this message
Andreas Roehler (a-roehler) wrote :

On 26.02.2015 20:16, Justin wrote:
> I ran this from command line. Should I run it a different way?
>
> emacs -batch -l ert -l py-ert-tests-1.el -f ert-run-tests-batch-and-exit

Add a -l python-mode.el

BTW please don't top-post

Revision history for this message
Justin (justin-grana) wrote :

Sorry about it. This time, the test does not return an error.

Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.