all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nitish <nitishch@protonmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: "30822@debbugs.gnu.org" <30822@debbugs.gnu.org>
Subject: bug#30822: 25.3; python-shell-send-defun sends only one line
Date: Fri, 06 Apr 2018 23:37:29 -0400	[thread overview]
Message-ID: <AfGNeOB2xJU6pKZ7tziB1xJXc-ZCpOEI9kHNkw7AdRapHzwjVZSE632Wbjzjsx51Nk4obBGAChIh9Fn4w5yO5tNpTjN9sQPLatV8vBCIH8w=@protonmail.com> (raw)
In-Reply-To: <87a7ufoh34.fsf@gmail.com>

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

Attaching the updated patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-python-shell-send-defun-for-functions-starting-a.patch --]
[-- Type: text/x-patch; name="0001-Fix-python-shell-send-defun-for-functions-starting-a.patch", Size: 1096 bytes --]

From ee7aacb36671bf8321156d9e72d7f41282083a5e Mon Sep 17 00:00:00 2001
From: nitishch <nitishchandrachinta@gmail.com>
Date: Sat, 7 Apr 2018 08:45:03 +0530
Subject: [PATCH] Fix python-shell-send-defun for functions starting at
 beginning of file

---
 lisp/progmodes/python.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index afafd1b42c..adf7b33ccb 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3163,9 +3163,12 @@ python-shell-send-defun
                        (beginning-of-line 1))
                    (> (current-indentation) 0)))
        (when (not arg)
-         (while (and (forward-line -1)
-                     (looking-at (python-rx decorator))))
-         (forward-line 1))
+         (while (and
+                 (eq (forward-line -1) 0)
+                 (if (looking-at (python-rx decorator))
+                     t
+                   (forward-line 1)
+                   nil))))
        (point-marker))
      (progn
        (or (python-nav-end-of-defun)
-- 
2.16.2


  reply	other threads:[~2018-04-07  3:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 20:05 bug#30822: 25.3; python-shell-send-defun sends only one line David Liu
2018-03-14 20:37 ` David Liu
2018-03-15  0:22   ` Noam Postavsky
2018-04-06  3:22 ` Nitish
2018-04-07  2:26   ` Noam Postavsky
2018-04-07  2:45     ` Nitish
2018-04-07  3:01       ` Noam Postavsky
2018-04-07  3:37         ` Nitish [this message]
2018-04-08 16:07           ` Noam Postavsky
2018-04-08 16:21             ` Nitish
2018-04-08 16:44           ` Noam Postavsky
2018-04-09  6:12             ` Andreas Röhler
2018-04-09 11:56               ` Noam Postavsky
2018-04-11 14:49                 ` Andreas Röhler
2018-04-11 14:57                   ` Noam Postavsky
2018-04-11 17:29                     ` Andreas Röhler
2018-04-11 17:33                       ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AfGNeOB2xJU6pKZ7tziB1xJXc-ZCpOEI9kHNkw7AdRapHzwjVZSE632Wbjzjsx51Nk4obBGAChIh9Fn4w5yO5tNpTjN9sQPLatV8vBCIH8w=@protonmail.com' \
    --to=nitishch@protonmail.com \
    --cc=30822@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.