From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carlos Pita Newsgroups: gmane.emacs.bugs Subject: bug#18084: closed (24.3.92; python.el: buggy ipython support) Date: Mon, 28 Jul 2014 11:36:14 -0300 Message-ID: References: <87oawaw17w.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133c20a8b06c604ff41d930 X-Trace: ger.gmane.org 1406558252 13139 80.91.229.3 (28 Jul 2014 14:37:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2014 14:37:32 +0000 (UTC) To: 18084@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 28 16:37:24 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XBm3B-0005jX-Tz for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jul 2014 16:37:18 +0200 Original-Received: from localhost ([::1]:40071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBm3B-0007rN-GP for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Jul 2014 10:37:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBm34-0007qH-0w for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 10:37:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBm2w-00082s-PX for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 10:37:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBm2w-00082n-Kh for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 10:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XBm2w-0004gL-8B for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 10:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Carlos Pita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Jul 2014 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18084-submit@debbugs.gnu.org id=B18084.140655821217976 (code B ref 18084); Mon, 28 Jul 2014 14:37:02 +0000 Original-Received: (at 18084) by debbugs.gnu.org; 28 Jul 2014 14:36:52 +0000 Original-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 Original-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 Original-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) Original-Received: by 10.112.137.38 with HTTP; Mon, 28 Jul 2014 07:36:14 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91886 Archived-At: --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--