Subject: bug#15510: Make python.el work with IPython automatically

From: Stefan Monnier <[email-masked]>
Date: Thu, 03 Oct 2013 00:32:02 -0400

Package: Emacs
Version: 24.3.50

I think python.el should try to automatically detect which kind of
interactive loop is running and use the corresponding invocation, so
users don't need to manually set python-shell-prompt-* and
python-shell-completion-* variables (and they can then even switch
between various interactive Python shells seamlessly).

        Stefan

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.20)
 of 2013-09-25 on pastel
Bzr revision: [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure -C --enable-checking --enable-check-lisp-object-type
 'CFLAGS=-Wall -g3 -O1 -Wno-pointer-sign''

Important settings:
  value of $LANG: fr_CH.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: InactiveMinibuffer

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<right> <right> <right> <backspace> 1 C-e <left> <left> 
<backspace> 1 <backspace> 4 <backspace> 4 C-e C-a C-SPC 
<down> M-w C-y <up> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<left> <backspace> <backspace> e n C-h f <return> <switch-frame> 
<switch-frame> C-e <right> <backspace> C-x C-s C-x 
v = <switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<help-echo> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> C-x C-c <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
C-u C-x 5 1 C-s i p y t h o n C-s C-s C-a <help-echo> 
M-< C-e <right> <down> <down> <down> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> C-SPC C-e M-w <switch-frame> M-x r 
e p - e m - b u <tab> <return>

Recent messages:
Wrote /home/monnier/src/emacs/trunk/lisp/subr.el
Mark saved where search started
Mark set [2 times]
Auto-saving...done
Mark set [4 times]

Saving file /home/monnier/src/emacs/trunk/lisp/subr.el...
Wrote /home/monnier/src/emacs/trunk/lisp/subr.el
Finding changes in /home/monnier/src/emacs/trunk/lisp/subr.el...done
Mark saved where search started

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/company/.dir-locals hides /home/monnier/src/emacs/work/lisp/gnus/.dir-locals

Features:
(sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev mailheader sendmail rfc2047
rfc2045 ietf-drums mail-utils mule-diag dabbrev pcase grep etags
benchmark cc-compat log-edit pcvs-util vc-sccs vc-svn vc-cvs vc-rcs
vc-dir semantic/db-mode semantic/decorate/include semantic/decorate/mode
semantic/decorate pulse semantic/db-find semantic/db-ref
semantic/bovine/c-by semantic/lex-spp semantic/idle semantic/bovine/gcc
semantic/dep semantic/bovine semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn semantic/db eieio-base semantic/ctxt
semantic/format ezimage semantic/tag-ls semantic/find
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet hideif cpp cmacexp cc-mode two-column
kmacro cc-fonts cc-awk cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-langs cc-vars cc-defs whitespace vc bug-reference add-log
xscheme unsafep trace testcover shadow scheme re-builder profiler
inf-lisp ielm pp gmm-utils ert find-func ewoc elp edebug cl-indent
sgml-mode view cal-china lunar solar cal-dst cal-bahai cal-islam
cal-hebrew holidays hol-loaddefs warnings cal-french diary-lib
diary-loaddefs cal-move cal-menu calendar cal-loaddefs vc-dispatcher
smerge-mode diff-mode conf-mode debug autorevert filenotify doc-view
jka-compr image-mode dired format-spec misearch multi-isearch reftex-dcr
reftex reftex-vars tex-mode compile shell pcomplete comint ansi-color
ring latexenc executable copyright cus-edit cus-start cus-load wid-edit
vc-bzr filecache haskell-font-lock mule-util haskell-doc imenu
haskell-indent haskell-mode server noutline outline easy-mmode flyspell
ispell eldoc checkdoc thingatpt help-mode advice help-fns electric
url-handlers url-parse auth-source eieio byte-opt bytecomp byte-compile
cconv eieio-core gnus-util mm-util mail-prsvr password-cache url-vars
reveal autoinsert proof-site proof-autoloads cl-macs gv cl cl-loaddefs
cl-lib pg-vars uniquify time-date savehist minibuf-eldef disp-table
finder-inf info easymenu package bbdb-autoloads agda2 vm-autoloads
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)