unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18084: 24.3.92; python.el: buggy ipython support
@ 2014-07-22 20:54 Carlos Pita
  2014-07-28  4:34 ` Fabián Ezequiel Gallina
       [not found] ` <handler.18084.D18084.140652207214816.notifdone@debbugs.gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Carlos Pita @ 2014-07-22 20:54 UTC (permalink / raw)
  To: 18084

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'





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18084: 24.3.92; python.el: buggy ipython support
  2014-07-22 20:54 bug#18084: 24.3.92; python.el: buggy ipython support Carlos Pita
@ 2014-07-28  4:34 ` Fabián Ezequiel Gallina
       [not found] ` <handler.18084.D18084.140652207214816.notifdone@debbugs.gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-07-28  4:34 UTC (permalink / raw)
  To: 18084-done


Fixed at revno 117595 in trunk.

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


Cheers,
Fabián





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18084: closed (24.3.92; python.el: buggy ipython support)
       [not found] ` <handler.18084.D18084.140652207214816.notifdone@debbugs.gnu.org>
@ 2014-07-28 14:36   ` Carlos Pita
  2014-07-28 21:10     ` Fabián Ezequiel Gallina
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Pita @ 2014-07-28 14:36 UTC (permalink / raw)
  To: 18084

[-- Attachment #1: Type: text/plain, Size: 3396 bytes --]

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.<TAB>

works as expected, but:

 In[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=18084
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
>
>
> ---------- Forwarded message ----------
> From: fgallina@gnu.org (Fabián 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án
>
>
>
> ---------- Forwarded message ----------
> From: Carlos Pita <carlosjosepita@gmail.com>
> 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.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'
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 4396 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18084: closed (24.3.92; python.el: buggy ipython support)
  2014-07-28 14:36   ` bug#18084: closed (24.3.92; python.el: buggy ipython support) Carlos Pita
@ 2014-07-28 21:10     ` Fabián Ezequiel Gallina
  0 siblings, 0 replies; 4+ messages in thread
From: Fabián Ezequiel Gallina @ 2014-07-28 21:10 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 18084

Carlos Pita <carlosjosepita@gmail.com> 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.<TAB>
>
> works as expected, but:
>
> In[20]:str.<TAB>
>
> 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án





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-28 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22 20:54 bug#18084: 24.3.92; python.el: buggy ipython support Carlos Pita
2014-07-28  4:34 ` Fabián Ezequiel Gallina
     [not found] ` <handler.18084.D18084.140652207214816.notifdone@debbugs.gnu.org>
2014-07-28 14:36   ` bug#18084: closed (24.3.92; python.el: buggy ipython support) Carlos Pita
2014-07-28 21:10     ` Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).