From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dan Davison Newsgroups: gmane.emacs.bugs Subject: bug#24322: [PATCH] Re: 25.1.50; Python completion should not strip trailing space Date: Sat, 27 Aug 2016 21:21:47 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113ec7f493eb19053b1438f8 X-Trace: blaine.gmane.org 1472333005 807 195.159.176.226 (27 Aug 2016 21:23:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Aug 2016 21:23:25 +0000 (UTC) To: 24322@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 27 23:23:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdl4Q-0007l5-Ux for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Aug 2016 23:23:19 +0200 Original-Received: from localhost ([::1]:37231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdl4N-0007iR-4f for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Aug 2016 17:23:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdl4E-0007di-Rg for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 17:23:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdl4A-0001mN-IV for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 17:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdl4A-0001mJ-EM for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 17:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bdl4A-0002YP-9f for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2016 17:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dan Davison Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Aug 2016 21:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24322 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24322-submit@debbugs.gnu.org id=B24322.14723329269741 (code B ref 24322); Sat, 27 Aug 2016 21:23:02 +0000 Original-Received: (at 24322) by debbugs.gnu.org; 27 Aug 2016 21:22:06 +0000 Original-Received: from localhost ([127.0.0.1]:42241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdl3F-0002X2-JY for submit@debbugs.gnu.org; Sat, 27 Aug 2016 17:22:05 -0400 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:36098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bdl3E-0002WY-6W for 24322@debbugs.gnu.org; Sat, 27 Aug 2016 17:22:04 -0400 Original-Received: by mail-it0-f47.google.com with SMTP id e63so48476027ith.1 for <24322@debbugs.gnu.org>; Sat, 27 Aug 2016 14:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=mLaZZr3yW0zfVA/n832GQ201FkuKiZS03W1TifSe3hg=; b=cbhM4A6nvYMLpA3q9H12wAMTEoJfP8qV/Oo7oqrx/fW4mWcan4PVj1eIw/qdkjiBhy m2+XzP81E44M6QRU+d3w5MOmewI0wDpjmdh1wspPZCq/fgjywmxDIEjdoPxkzYZz09Y7 NhrkcpW7WI+aorDL3+jtSXeGNhpXfCrxq2lUKCptYQS4hh6ZxOEq8HqUaj9oSzYrVe9b Qc4G+Gyqw2sNRqHqggdyeimX/VuACJg9GgMl+T+AO4sIwMjyu6cCMTHJ9zPqvidSvJhg yHGwvBClubiqSJP+cNy3HFA5fQdDQ/LHBiOdSThVSXkUk9CgvbUP75pM0018Mm3sw6UK 7bAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=mLaZZr3yW0zfVA/n832GQ201FkuKiZS03W1TifSe3hg=; b=QJxnkxt5Fw7XmdvYnPvjSPxya9h27wMoDaW73zwSNFNKXTXTK+GCFiZQTdIzaghxVT SroiYZnR3jCUK4/zvz8pnyuAF7mS+HcVUStrjXsix0w0F3P86FIwWA7IvC4CMd2OYr2O Cdx6ERvSukYl7mhPx2bjLtg+DeX9/CrVOjFVJiZpoT/uGCdAXqJHCM82uVoyKcf+I1eP PHGqAy4g7kmP3/c2lcJOzEQghCATzL8vw40KkUzgm+qKK/ZIVfmogu7adFRDGD/O6xik cTZriAdH6EaDU/q1xlpZJCCpmlTK527kAFRYYrRtCPkTKQ91zMx7pKt3QgmNLwZiwQa1 v1tw== X-Gm-Message-State: AE9vXwORUQPqZVlasXIC3tzIReyRtLa/+zV/rfQsxZ61NMhmx7qrAxgbHrUibL3EQ/VgWqsrTFubjjTYf2Tw/Q== X-Received: by 10.107.11.170 with SMTP id 42mr12035722iol.184.1472332918144; Sat, 27 Aug 2016 14:21:58 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:122728 Archived-At: --001a113ec7f493eb19053b1438f8 Content-Type: multipart/alternative; boundary=001a113ec7f493eb14053b1438f6 --001a113ec7f493eb14053b1438f6 Content-Type: text/plain; charset=UTF-8 Patch attached. This patch is also available as a pull request at at https://github.com/dandavison/emacs/pull/1 The commit hash is 8e69b33a53ea30389a5e3946dd711320a77e0d23. I have only tested this on macOS. As far as I am aware, when the space character is present, it is present deliberately and it is appropriate to retain it, but I would appreciate feedback from python.el experts. On Sat, 27 Aug 2016 at 14:10 Dan Davison wrote: > From emacs -Q: > > (setq python-shell-interpreter "ipython" > python-shell-interpreter-args "-i") > > M-x run-python > > In the python comint buffer insert "from itertools imp" and hit tab. > > You will see "imp" completed as "import" (no trailing space). > > However, if you do this in ipython itself, you will see "imp" completed > as "import ". This (i.e. what ipython does) is the desired behavior > (because import is always followed by another word). > > In GNU Emacs 25.1.50.1 (x86_64-apple-darwin14.5.0, NS appkit-1348.17 > Version 10.10.5 (Build 14F27)) > of 2016-04-16 built on hemiprocne > Repository revision: 934549e23d6bda5231375dbfed7b42a966c85d14 > Windowing system distributor 'Apple', version 10.3.1348 > Configured using: > 'configure --prefix=/usr/local/Cellar/emacs/HEAD > --enable-locallisppath=/usr/local/share/emacs/site-lisp > --infodir=/usr/local/Cellar/emacs/HEAD/share/info/emacs --with-xml2 > --without-dbus --without-gnutls --with-ns --disable-ns-self-contained' > > Configured features: > JPEG NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS > > Important settings: > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: Lisp Interaction > > Minor modes in effect: > tooltip-mode: t > global-eldoc-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > > Load-path shadows: > None found. > > Features: > (shadow sort mail-extr emacsbug message dired dired-loaddefs format-spec > rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config > gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse > rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 > ietf-drums mm-util mail-prsvr mail-utils time-date mule-util tooltip > eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel > term/ns-win ns-win ucs-normalize term/common-win tool-bar dnd fontset > image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode > prog-mode register page menu-bar rfn-eshadow timer select scroll-bar > mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame > cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai > tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian > slovak czech european ethiopic indian cyrillic chinese charscript > case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer > cl-preloaded 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 kqueue cocoa ns > multi-tty make-network-process emacs) > > Memory information: > ((conses 16 195970 9329) > (symbols 48 19431 0) > (miscs 40 43 170) > (strings 32 14792 5110) > (string-bytes 1 431078) > (vectors 16 32763) > (vector-slots 8 640839 4764) > (floats 8 156 54) > (intervals 56 194 0) > (buffers 976 11)) > > --001a113ec7f493eb14053b1438f6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Patch attached.

This patch is also avai= lable as a pull request at at=C2=A0https://github.com/dandavison/emacs/pull/1=C2=A0The comm= it hash is=C2=A08e69b33a53ea30389a5e3946dd711320a77e0d23.

I have only tested this on macOS. As far as I am aware, when the sp= ace character is present, it is present deliberately and it is appropriate = to retain it, but I would appreciate feedback from python.el experts.
=

On Sat, 27 Aug 2016 at= 14:10 Dan Davison <dandavison7= @gmail.com> wrote:
From emacs -Q:

(setq python-shell-in= terpreter "ipython"
=C2=A0 =C2=A0 =C2=A0 python-shell-i= nterpreter-args "-i")

M-x run-python

In the python comint buffer insert "from itertoo= ls imp" and hit tab.

You will see "imp&q= uot; completed as "import" (no trailing space).

However, if you do this in ipython itself, you will see "imp&q= uot; completed
as "import ". This (i.e. what ipython do= es) is the desired behavior
(because import is always followed by= another word).

In GNU Emacs 25.1.50.1 (x86_64-app= le-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F27))
=C2=A0of 2016-04-16 built on hemiprocne
Repository revision: 934= 549e23d6bda5231375dbfed7b42a966c85d14
Windowing system distributo= r 'Apple', version 10.3.1348
Configured using:
= =C2=A0'configure --prefix=3D/usr/local/Cellar/emacs/HEAD
=C2= =A0--enable-locallisppath=3D/usr/local/share/emacs/site-lisp
=C2= =A0--infodir=3D/usr/local/Cellar/emacs/HEAD/share/info/emacs --with-xml2
=C2=A0--without-dbus --without-gnutls --with-ns --disable-ns-self-c= ontained'

Configured features:
JPEG = NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Imp= ortant settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2= =A0 locale-coding-system: utf-8-unix

Major mode: L= isp Interaction

Minor modes in effect:
= =C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2= =A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
= =C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 = file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
= =C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: = t
=C2=A0 transient-mark-mode: t

Recent m= essages:
For information about GNU Emacs and the GNU system, type= C-h C-a.

Load-path shadows:
None found.=

Features:
(shadow sort mail-extr emacsb= ug message dired dired-loaddefs format-spec
rfc822 mml easymenu m= ml-sec password-cache epa derived epg epg-config
gnus-util rmail = rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 m= ailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drum= s mm-util mail-prsvr mail-utils time-date mule-util tooltip
eldoc= electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
ter= m/ns-win ns-win ucs-normalize term/common-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-ba= r
mouse jit-lock font-lock syntax facemenu font-core term/tty-col= ors frame
cl-generic cham georgian utf-8-lang misc-lang vietnames= e tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebr= ew greek romanian
slovak czech european ethiopic indian cyrillic = chinese charscript
case-table epa-hook jka-cmpr-hook help simple = abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button fa= ces cus-face macroexp files
text-properties overlay sha1 md5 base= 64 format env code-pages mule
custom widget hashtable-print-reada= ble backquote kqueue cocoa ns
multi-tty make-network-process emac= s)

Memory information:
((conses 16 19597= 0 9329)
=C2=A0(symbols 48 19431 0)
=C2=A0(miscs 40 43 1= 70)
=C2=A0(strings 32 14792 5110)
=C2=A0(string-bytes 1= 431078)
=C2=A0(vectors 16 32763)
=C2=A0(vector-slots 8= 640839 4764)
=C2=A0(floats 8 156 54)
=C2=A0(intervals = 56 194 0)
=C2=A0(buffers 976 11))

--001a113ec7f493eb14053b1438f6-- --001a113ec7f493eb19053b1438f8 Content-Type: application/octet-stream; name="0001-Don-t-strip-space-from-python-completions.patch" Content-Disposition: attachment; filename="0001-Don-t-strip-space-from-python-completions.patch" Content-Transfer-Encoding: base64 Content-ID: <156cdda40caa93885781> X-Attachment-Id: 156cdda40caa93885781 RnJvbSA4ZTY5YjMzYTUzZWEzMDM4OWE1ZTM5NDZkZDcxMTM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