From unknown Sat Jun 21 12:10:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18084 <18084@debbugs.gnu.org> To: bug#18084 <18084@debbugs.gnu.org> Subject: Status: 24.3.92; python.el: buggy ipython support Reply-To: bug#18084 <18084@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:10:45 +0000 retitle 18084 24.3.92; python.el: buggy ipython support reassign 18084 emacs submitter 18084 Carlos Pita severity 18084 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 22 16:56:28 2014 Received: (at submit) by debbugs.gnu.org; 22 Jul 2014 20:56:28 +0000 Received: from localhost ([127.0.0.1]:34955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X9h6n-0007J4-SD for submit@debbugs.gnu.org; Tue, 22 Jul 2014 16:56:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44132) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X9h59-0007F7-Be for submit@debbugs.gnu.org; Tue, 22 Jul 2014 16:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9h53-00088H-0p for submit@debbugs.gnu.org; Tue, 22 Jul 2014 16:54:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9h52-000889-Uq for submit@debbugs.gnu.org; Tue, 22 Jul 2014 16:54:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9h51-0006NV-Vv for bug-gnu-emacs@gnu.org; Tue, 22 Jul 2014 16:54:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9h51-00087m-27 for bug-gnu-emacs@gnu.org; Tue, 22 Jul 2014 16:54:35 -0400 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:57663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9h50-00087K-Qd for bug-gnu-emacs@gnu.org; Tue, 22 Jul 2014 16:54:34 -0400 Received: by mail-lb0-f176.google.com with SMTP id u10so186011lbd.35 for ; Tue, 22 Jul 2014 13:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=V7XO5suy+6JM15prFpfbZGJD94qjcCOoMsW9pZ0gwqI=; b=ZF+ieq0qJf6K0Zje+JGO447QMpxSXiyJpggBaAwL6W48c2hEJ3I9kzRWRdOLx1Uw3/ bjwXhGSdU54argIqUsL0t07Lw3Zl7YWF7Pa5Sfy78OPdsGha/JJV2BN16uUwmZM4NdZD /y5lB2qhFG6HQTRF27rDJuvr7h39CXvWM8qFWp+khMDlEu6jOhJJU6t+67Lb1xvzDkqJ /mvLLLezBeE4raCPd8ZLyZDKLzGLN+gPuJ/LW7eoTfQrSx5TzK2azsJD7DfZH7rE87jL mOtRqIntkT4Ki+9BuWNucAswnLGajVUL/FSoWOYzLRQKo34riPEmxzJsAzOUlppDw6ZB jo+w== X-Received: by 10.112.93.171 with SMTP id cv11mr14202001lbb.100.1406062472669; Tue, 22 Jul 2014 13:54:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.137.38 with HTTP; Tue, 22 Jul 2014 13:54:12 -0700 (PDT) From: Carlos Pita Date: Tue, 22 Jul 2014 17:54:12 -0300 Message-ID: Subject: 24.3.92; python.el: buggy ipython support To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 22 Jul 2014 16:56:23 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Ipython is pretty smart doing autocompletion and output coloring but python.el is currently getting in its way: 1) The coloring is heuristic at best. It's ok for the vanilla python interpreter but not nearly as good as ipython's. Not only keywords and identifiers are colored in non-code contexts, but also string quoting gets often messed up. I think the best option is to disable font lock by default when the interpreter is ipython. 2) Autocompletion of magic commands is broken. Autocompletion of paths is broken. Maybe another kind of ipython specific autocompletion is broken too. Currently the autocompletion prefix is parsed from the buffer using a "dotty" syntax table that includes '.' and '_' as part of identifiers. Clearly this is not enough to play well with ipython. But fortunately it's not necessary to be too smart. Sendind the prefix up to the first preceding whitespace char will do the trick. So I propose to: i) Disable font lock by default for ipython. ii) Parsing the prefix up to whitespace char for ipython autocompletion. I think these solutions are very simple and will improve the ipython experience a lot. Obviously the color theme will differ from the one for python-mode but this is a minor annoyance for such gain in simplicity. ----------- In GNU Emacs 24.3.92.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-07-22 on carlos Windowing system distributor `The X.Org Foundation', version 11.0.11502000 Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 00:34:32 2014 Received: (at 18084-done) by debbugs.gnu.org; 28 Jul 2014 04:34:32 +0000 Received: from localhost ([127.0.0.1]:39838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBcdr-0003qu-U2 for submit@debbugs.gnu.org; Mon, 28 Jul 2014 00:34:32 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:38054 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBcdp-0003ql-PL for 18084-done@debbugs.gnu.org; Mon, 28 Jul 2014 00:34:30 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:39986 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XBcdo-0004WZ-R9 for 18084-done@debbugs.gnu.org; Mon, 28 Jul 2014 00:34:29 -0400 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: 18084-done@debbugs.gnu.org Subject: 24.3.92; python.el: buggy ipython support Date: Mon, 28 Jul 2014 01:34:27 -0300 Message-ID: <87oawaw17w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: 18084-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) Fixed at revno 117595 in trunk. Also revno 117580 includes relevant changes on shell font-locking. Cheers, Fabi=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:36:52 2014 Received: (at 18084) by debbugs.gnu.org; 28 Jul 2014 14:36:52 +0000 Received: from localhost ([127.0.0.1]:40899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBm2i-0004fo-3W for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:36:52 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:46059) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBm2c-0004fW-1P for 18084@debbugs.gnu.org; Mon, 28 Jul 2014 10:36:46 -0400 Received: by mail-la0-f45.google.com with SMTP id ty20so5524558lab.32 for <18084@debbugs.gnu.org>; Mon, 28 Jul 2014 07:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=5wnGL4LQiA1Y6e9fVKQwDXf+shmK9TPemvZM7gvxEkY=; b=I8saHZOuKc1po/svh9z5vxN2vDCXQwQ99+zudEobo15/orVd9xR6F0WzVFMPW+y7TD /8NvFGH3kCsLtjH+R6yihiGZ5ORFtP/lcY7eA+FIfwyjuzzijjPzLAGhMCaivqtBkjjf w+8nb5oHp+NCUMrJFcple0KTmr8dHZI2AMYYeZufvl7S95Lo5Hen8Mk5GMkTmZbiXPYE AbHBMELy88i6WQoS1jiHU1FxcStuvIwto6SUPQaaFyd7cbTyf+L+n9l7Tp/ph/uoRyWe pFoY0reOPiI7NTIMLSxq14K26NUi5JUJ7xTJ4TxXefrm/AgDzuaRH7AglA5YFvzPeylV gWyg== X-Received: by 10.112.97.163 with SMTP id eb3mr20923439lbb.67.1406558194564; Mon, 28 Jul 2014 07:36:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.137.38 with HTTP; Mon, 28 Jul 2014 07:36:14 -0700 (PDT) In-Reply-To: References: <87oawaw17w.fsf@gnu.org> From: Carlos Pita Date: Mon, 28 Jul 2014 11:36:14 -0300 Message-ID: Subject: Re: bug#18084: closed (24.3.92; python.el: buggy ipython support) To: 18084@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a1133c20a8b06c604ff41d930 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18084 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a1133c20a8b06c604ff41d930 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Good work! It's working very well, che :). Till now I just was able to found this one quirk: if you delete the space between the prefix and the prompt completion gets broken. That is: In[20]: str. works as expected, but: In[20]:str. gets no completions. Looks to me like the prefix parser is not taking the prompt into account, feeding it to ipython. On Mon, Jul 28, 2014 at 1:35 AM, GNU bug Tracking System < help-debbugs@gnu.org> wrote: > Your bug report > > #18084: 24.3.92; python.el: buggy ipython support > > which was filed against the emacs package, has been closed. > > The explanation is attached below, along with your original report. > If you require more details, please reply to 18084@debbugs.gnu.org. > > -- > 18084: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18084 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems > > > ---------- Forwarded message ---------- > From: fgallina@gnu.org (Fabi=C3=A1n Ezequiel Gallina) > To: 18084-done@debbugs.gnu.org > Cc: > Date: Mon, 28 Jul 2014 01:34:27 -0300 > Subject: 24.3.92; python.el: buggy ipython support > > Fixed at revno 117595 in trunk. > > Also revno 117580 includes relevant changes on shell font-locking. > > > Cheers, > Fabi=C3=A1n > > > > ---------- Forwarded message ---------- > From: Carlos Pita > To: bug-gnu-emacs@gnu.org > Cc: > Date: Tue, 22 Jul 2014 17:54:12 -0300 > Subject: 24.3.92; python.el: buggy ipython support > Ipython is pretty smart doing autocompletion and output coloring but > python.el is currently getting in its way: > > 1) The coloring is heuristic at best. It's ok for the vanilla python > interpreter but not nearly as good as ipython's. Not only keywords and > identifiers are colored in non-code contexts, but also string quoting > gets often messed up. I think the best option is to disable font lock by > default when the interpreter is ipython. > > 2) Autocompletion of magic commands is broken. Autocompletion of paths > is broken. Maybe another kind of ipython specific autocompletion is > broken too. Currently the autocompletion prefix is parsed from the > buffer using a "dotty" syntax table that includes '.' and '_' as part of > identifiers. Clearly this is not enough to play well with ipython. But > fortunately it's not necessary to be too smart. Sendind the prefix up to > the first preceding whitespace char will do the trick. > > So I propose to: > > i) Disable font lock by default for ipython. > ii) Parsing the prefix up to whitespace char for ipython autocompletion. > > I think these solutions are very simple and will improve the ipython > experience a lot. Obviously the color theme will differ from the one for > python-mode but this is a minor annoyance for such gain in simplicity. > > ----------- > > In GNU Emacs 24.3.92.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2) > of 2014-07-22 on carlos > Windowing system distributor `The X.Org Foundation', version 11.0.1150200= 0 > Configured using: > `configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib > --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft > 'CFLAGS=3D-march=3Di686 -mtune=3Dgeneric -O2 -pipe -fstack-protector-str= ong > --param=3Dssp-buffer-size=3D4' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 > LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro' > > > > --001a1133c20a8b06c604ff41d930 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Good work! It's working very well, che = :). Till now I just was able to found this one quirk: if you delete the spa= ce between the prefix and the prompt completion gets broken. That is:
In[20]: str.<TAB>

works as expected, but:

= =C2=A0In[20]:str.<TAB>

gets no completions. Looks to me = like the prefix parser is not taking the prompt into account, feeding it to= ipython.




On Mon, Jul 28, 2014 at 1:35 AM, GNU bug Tracking System <help-debbugs= @gnu.org> wrote:
Your bug report

#18084: 24.3.92; python.el: buggy ipython support

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 18084@debbugs.gnu.org.

--
18084: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18084
GNU Bug Tracking System
Contact help-debbugs@gnu.org wi= th problems


---------- Forwarded message ----------
From:=C2= =A0fgallina@gnu.org (Fabi=C3=A1n Ez= equiel Gallina)
To:=C2=A01= 8084-done@debbugs.gnu.org
Cc:=C2=A0
Date:=C2=A0Mon, 28 Jul 2014 01:34:27 -0300
Subject:=C2=A024= .3.92; python.el: buggy ipython support

Fixed at revno 117595 in trunk.

Also revno 117580 includes relevant changes on shell font-locking.


Cheers,
Fabi=C3=A1n



---------- Forwarded message ----------
From:=C2=A0Carlos Pita &= lt;carlosjosepita@gmail.com= >
To:=C2=A0bug-gnu-emacs@gnu= .org
Cc:=C2=A0
Date:=C2=A0Tue, 22 Jul 2014 17:54:12 -0300
Subject:=C2=A024= .3.92; python.el: buggy ipython support
Ipython is pretty smart doing au= tocompletion and output coloring but
python.el is currently getting in its way:

1) The coloring is heuristic at best. It's ok for the vanilla python interpreter but not nearly as good as ipython's. Not only keywords and<= br> identifiers are colored in non-code contexts, but also string quoting
gets often messed up. I think the best option is to disable font lock by default when the interpreter is ipython.

2) Autocompletion of magic commands is broken. Autocompletion of paths
is broken. Maybe another kind of ipython specific autocompletion is
broken too. Currently the autocompletion prefix is parsed from the
buffer using a "dotty" syntax table that includes '.' and= '_' as part of
identifiers. Clearly this is not enough to play well with ipython. But
fortunately it's not necessary to be too smart. Sendind the prefix up t= o
the first preceding whitespace char will do the trick.

So I propose to:

i) Disable font lock by default for ipython.
ii) Parsing the prefix up to whitespace char for ipython autocompletion.
I think these solutions are very simple and will improve the ipython
experience a lot. Obviously the color theme will differ from the one for python-mode but this is a minor annoyance for such gain in simplicity.

-----------

In GNU Emacs 24.3.92.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2)
=C2=A0of 2014-07-22 on carlos
Windowing system distributor `The X.Org Foundation', version 11.0.11502= 000
Configured using:
=C2=A0`configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/li= b
=C2=A0--localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft
=C2=A0'CFLAGS=3D-march=3Di686 -mtune=3Dgeneric -O2 -pipe -fstack-protec= tor-strong
=C2=A0--param=3Dssp-buffer-size=3D4' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 =C2=A0LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro'




--001a1133c20a8b06c604ff41d930-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 17:10:57 2014 Received: (at 18084) by debbugs.gnu.org; 28 Jul 2014 21:10:57 +0000 Received: from localhost ([127.0.0.1]:41302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBsC8-00065M-RR for submit@debbugs.gnu.org; Mon, 28 Jul 2014 17:10:57 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57032 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBsC5-00065B-BQ for 18084@debbugs.gnu.org; Mon, 28 Jul 2014 17:10:54 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:47022 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XBsC4-000284-8e; Mon, 28 Jul 2014 17:10:52 -0400 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: Carlos Pita Subject: Re: bug#18084: closed (24.3.92; python.el: buggy ipython support) References: <87oawaw17w.fsf@gnu.org> Date: Mon, 28 Jul 2014 18:10:51 -0300 In-Reply-To: (Carlos Pita's message of "Mon, 28 Jul 2014 11:36:14 -0300") Message-ID: <87ha212nqc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 18084 Cc: 18084@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Carlos Pita writes: > Good work! It's working very well, che :). Till now I just was able to > found this one quirk: if you delete the space between the prefix and > the prompt completion gets broken. That is: > > In[20]: str. > > works as expected, but: > > In[20]:str. > > gets no completions. Looks to me like the prefix parser is not taking > the prompt into account, feeding it to ipython. > Which is expected, as the end of prompt is the last resort for our input prefix start when looking for completions. Revno 117605 makes inferior-python-mode to set comint-prompt-read-only to t so messing around with the input prompt is not allowed. Regards, Fabi=C3=A1n From unknown Sat Jun 21 12:10:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 Aug 2014 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator