From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Liu Newsgroups: gmane.emacs.bugs Subject: bug#30822: 25.3; python-shell-send-defun sends only one line Date: Wed, 14 Mar 2018 16:37:30 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1144f1501f7b9005676558dd" X-Trace: blaine.gmane.org 1521059771 15611 195.159.176.226 (14 Mar 2018 20:36:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Mar 2018 20:36:11 +0000 (UTC) To: 30822@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 14 21:36:07 2018 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 1ewD82-0003zC-MR for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Mar 2018 21:36:07 +0100 Original-Received: from localhost ([::1]:48191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewDA5-0004WM-RB for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Mar 2018 16:38:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewD9y-0004Vv-0g for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:38:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewD9u-0002A8-0d for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:38:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ewD9t-0002A0-TE for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ewD9t-0004Bk-MI for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Mar 2018 20:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30822 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152105987216083 (code B ref -1); Wed, 14 Mar 2018 20:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Mar 2018 20:37:52 +0000 Original-Received: from localhost ([127.0.0.1]:33692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewD9k-0004BL-7R for submit@debbugs.gnu.org; Wed, 14 Mar 2018 16:37:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewD9h-0004B6-TT for submit@debbugs.gnu.org; Wed, 14 Mar 2018 16:37:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewD9b-00022a-0C for submit@debbugs.gnu.org; Wed, 14 Mar 2018 16:37:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewD9a-00022U-SC for submit@debbugs.gnu.org; Wed, 14 Mar 2018 16:37:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewD9Y-0004TC-RI for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:37:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewD9U-000207-Qq for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:37:40 -0400 Original-Received: from alum-mailsec-scanner-2.mit.edu ([18.7.68.13]:46436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewD9U-0001zK-GC for bug-gnu-emacs@gnu.org; Wed, 14 Mar 2018 16:37:36 -0400 X-AuditID: 1207440d-98bff70000000c05-ca-5aa9880c571f Original-Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by alum-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id DF.C9.03077.D0889AA5; Wed, 14 Mar 2018 16:37:33 -0400 (EDT) Original-Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) (authenticated bits=0) (User authenticated as daveliu@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id w2EKbVXC031462 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Wed, 14 Mar 2018 16:37:32 -0400 Original-Received: by mail-oi0-f49.google.com with SMTP id x12so3830966oie.13 for ; Wed, 14 Mar 2018 13:37:32 -0700 (PDT) X-Gm-Message-State: AElRT7Egw97lk0YNrzN4/C5h1wJZJFHC03rCU0bfTzsW7tyiR/YzYjJs 1DCUbgw31hPwXaVsBWe0XgqLiGAnLW/r5iovKXg= X-Google-Smtp-Source: AG47ELsWlLG2rItKNoOrI+kCbbdklAlbAMF6Cl29GauL2/Xlu1ZckWB6vHXYJI7Gm54emthmdcOOBeklzqOH/np+w60= X-Received: by 10.202.166.15 with SMTP id p15mr3405922oie.149.1521059851367; Wed, 14 Mar 2018 13:37:31 -0700 (PDT) Original-Received: by 2002:a9d:440b:0:0:0:0:0 with HTTP; Wed, 14 Mar 2018 13:37:30 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJKsWRmVeSWpSXmKPExsUixO6iqMvbsTLKYNMNS4vvB6ocGD3appkF MEZx2aSk5mSWpRbp2yVwZbz7tZ+p4FBMxct1PWwNjHcDuxg5OCQETCRmvyntYuTiEBLYwSQx Yfd9NgjnCZPE/fnzmSCcCYwSy4+sAspwAnWUS/Te+wplF0m8vXiZBcIukWjbd4AdxOYVEJQ4 OfMJWFxIIFxi9c4OdpBtnAKBEtfeFYGYQgIBEk9n5ICYbAJqEk8eSYEUswioSiy8uJUJYmCi xOtTb1hBSniBqm/clwAJCwvYSVy8sRdstoiApMTXO62sIDazgI/E79vnWCYwCs1CcsIsJCkI W1OidftvdghbQ2LBnX2MELa2xLKFr5kXMLKuYpRLzCnN1c1NzMwpTk3WLU5OzMtLLdI10svN LNFLTSndxAgJdd4djP/XyRxiFOBgVOLhNVBbGSXEmlhWXJl7iFGSg0lJlHf/lBVRQnxJ+SmV GYnFGfFFpTmpxYcYJTiYlUR47xcClfOmJFZWpRblw6SkOViUxHnVlqj7CQmkJ5akZqemFqQW wWRlODiUJHh124EaBYtS01Mr0jJzShDSTBycIMN5gIbzgtTwFhck5hZnpkPkTzHGcnyb9aCN maPpAYj8Nu05kPzz8CWQ3PIIRB4Ak12PQeSNF6+B5K4Jvd3MQix5+XmpUuK8WW1AQwVAhmaU 5sHthaXAV4ziwGAQ5mUBWc0DTJ9wm18BHcUEdFTmthUgR5UkIqSkGhhnLg/fHHG+8LVsS+rn pMyrx3cYp2/2cJWc+L402+a71n1HB2GhvfGNTE6Zml8OKj41PbUx/L9b7Pc1jbkp X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:144287 Archived-At: --001a1144f1501f7b9005676558dd Content-Type: text/plain; charset="UTF-8" regarding the possible bug with python-shell-send-defun, it seems to *only* occurs if the python function starts on the very first line of the file. Otherwise, python-shell-send-defun works perfectly. On Wed, Mar 14, 2018 at 4:05 PM, David Liu wrote: > note: no other Python-related emacs packages are being used; > only the builtin one. > > 1. create new file "test.py" with following: > > def f(x): > return x+1 > > 2. C-c C-p to run-python > > 3. place point immediately after "return x+1" > > 4. C-M-x for python-shell-send-defun > > result: > > SyntaxError: 'return' outside function > > it appears that only one line is being sent, instead of both lines. > > > > In GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version > 10.9.5 (Build 13F1911)) > of 2017-09-12 built on builder10-9.local > Windowing system distributor 'Apple', version 10.3.1561 > Configured using: > 'configure --with-ns '--enable-locallisppath=/Library/Application > Support/Emacs/${version}/site-lisp:/Library/Application > Support/Emacs/site-lisp' --with-modules' > > Configured features: > NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES > > Important settings: > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: Python > > Minor modes in effect: > shell-dirtrack-mode: t > tooltip-mode: t > global-eldoc-mode: t > electric-indent-mode: t > mouse-wheel-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: > uncompressing python.el.gz...done > Making completion list... > t > > delete-backward-char: Text is read-only > Quit > > is undefined > mouse-2, RET: find function's definition > uncompressing python.el.gz...done > > Load-path shadows: > /Users/daveliu/quicklisp/dists/quicklisp/software/slime-v2.20/slime-autoloads > hides /Users/daveliu/.emacs.d/elpa/slime-20180308.733/slime-autoloads > /Users/daveliu/quicklisp/dists/quicklisp/software/slime-v2.20/slime-tests > hides /Users/daveliu/.emacs.d/elpa/slime-20180308.733/slime-tests > /Users/daveliu/quicklisp/dists/quicklisp/software/slime-v2.20/slime hides > /Users/daveliu/.emacs.d/elpa/slime-20180308.733/slime > > Features: > (shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg > mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils > mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils jka-compr > eieio-opt speedbar sb-image ezimage dframe find-func tramp-cache python > tramp-sh tramp tramp-compat auth-source gnus-util mm-util help-fns > mail-prsvr password-cache tramp-loaddefs trampver shell pcomplete > format-spec json map slime-fancy slime-trace-dialog slime-fontifying-fu > slime-package-fu slime-references slime-compiler-notes-tree > slime-scratch slime-presentations advice bridge slime-macrostep > macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy > slime-fancy-trace slime-fancy-inspector slime-c-p-c > slime-editing-commands slime-autodoc slime-repl elp slime-parse slime > derived edmacro kmacro lisp-mnt gud apropos compile etags xref cl-seq > project eieio eieio-core arc-mode archive-mode noutline outline > easy-mmode pp comint ansi-color ring hyperspec cl-macs thingatpt > browse-url cl tango-dark-theme finder-inf tex-site info slime-autoloads > package epg-config seq byte-opt gv bytecomp byte-compile cl-extra > help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util > tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type > mwheel 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 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 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 337784 17797) > (symbols 48 30156 0) > (miscs 40 149 592) > (strings 32 48025 8240) > (string-bytes 1 1429236) > (vectors 16 43362) > (vector-slots 8 786245 7866) > (floats 8 339 383) > (intervals 56 649 397) > (buffers 976 27)) > > --001a1144f1501f7b9005676558dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
regarding the possible bug with python-shell-send-defun, i= t seems to *only* occurs if the python function starts on the very first li= ne of the file. Otherwise, python-shell-send-defun works perfectly.

On Wed, Mar 14, 2018 = at 4:05 PM, David Liu <daveliu@alum.mit.edu> wrote:
note: no other Python-re= lated emacs packages are being used;
only the builtin one.

1. create new file "test.py" with followin= g:

def f(x):
=C2=A0 =C2=A0 return x+1

2. C-c C-p to run-python

3.= place point immediately after "return x+1"

<= div>4. C-M-x for python-shell-send-defun

result:

=C2=A0 =C2=A0 SyntaxError: 'return' outside= function

it appears that only one line is being s= ent, instead of both lines.



In GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 V= ersion 10.9.5 (Build 13F1911))
=C2=A0of 2017-09-12 built on build= er10-9.local
Windowing system distributor 'Apple', versio= n 10.3.1561
Configured using:
=C2=A0'configure --wi= th-ns '--enable-locallisppath=3D/Library/Application
=C2= =A0Support/Emacs/${version}/site-lisp:/Library/Application
= =C2=A0Support/Emacs/site-lisp' --with-modules'

=
Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_= SCROLL_BARS NS MODULES

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

Major mode: Python

Minor modes in effect:
=C2=A0 shell-dirtrack-mode: t
=
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
<= div>=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-nu= mber-mode: t
=C2=A0 transient-mark-mode: t

Recent messages:
uncompressing python.el.gz...done
M= aking completion list...
t

delete-backwa= rd-char: Text is read-only
Quit

<C-ta= b> is undefined
mouse-2, RET: find function's definition
uncompressing python.el.gz...done

Load-pa= th shadows:
/Users/daveliu/quicklisp/dists/quicklisp/softwar= e/slime-v2.20/slime-autoloads hides /Users/daveliu/.emacs.d/elpa/= slime-20180308.733/slime-autoloads
/Users/daveliu/quicklisp/= dists/quicklisp/software/slime-v2.20/slime-tests hides /Users/dav= eliu/.emacs.d/elpa/slime-20180308.733/slime-tests
/Users/dav= eliu/quicklisp/dists/quicklisp/software/slime-v2.20/slime hides /= Users/daveliu/.emacs.d/elpa/slime-20180308.733/slime

Features:
(shadow sort mail-extr emacsbug message dired r= fc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rf= c2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ie= tf-drums mail-utils jka-compr
eieio-opt speedbar sb-image ezimage= dframe find-func tramp-cache python
tramp-sh tramp tramp-compat = auth-source gnus-util mm-util help-fns
mail-prsvr password-cache = tramp-loaddefs trampver shell pcomplete
format-spec json map slim= e-fancy slime-trace-dialog slime-fontifying-fu
slime-package-fu s= lime-references slime-compiler-notes-tree
slime-scratch slime-pre= sentations advice bridge slime-macrostep
macrostep slime-mdot-fu = slime-enclosing-context slime-fuzzy
slime-fancy-trace slime-fancy= -inspector slime-c-p-c
slime-editing-commands slime-autodoc slime= -repl elp slime-parse slime
derived edmacro kmacro lisp-mnt gud a= propos compile etags xref cl-seq
project eieio eieio-core arc-mod= e archive-mode noutline outline
easy-mmode pp comint ansi-color r= ing hyperspec cl-macs thingatpt
browse-url cl tango-dark-theme fi= nder-inf tex-site info slime-autoloads
package epg-config seq byt= e-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv = cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electr= ic uniquify ediff-hook vc-hooks lisp-float-type
mwheel ns-win ucs= -normalize term/common-win tool-bar dnd fontset image
regexp-opt = fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode r= egister page menu-bar rfn-eshadow timer select scroll-bar
mouse j= it-lock font-lock syntax facemenu font-core 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-h= ook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadv= ice
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 informat= ion:
((conses 16 337784 17797)
=C2=A0(symbols 48 30156 = 0)
=C2=A0(miscs 40 149 592)
=C2=A0(strings 32 48025 824= 0)
=C2=A0(string-bytes 1 1429236)
=C2=A0(vectors 16 433= 62)
=C2=A0(vector-slots 8 786245 7866)
=C2=A0(floats 8 = 339 383)
=C2=A0(intervals 56 649 397)
=C2=A0(buffers 97= 6 27))


--001a1144f1501f7b9005676558dd--