From: immerrr again <immerrr@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 21671@debbugs.gnu.org
Subject: bug#21671: [PATCH] fix python.el hanging up during fontification #21657
Date: Tue, 23 Feb 2016 12:00:54 +0200 [thread overview]
Message-ID: <CAERznn8G=_Snhk7eLVWEH68OcjPn1ARAZXpJSJSSgMwfXWBUMw@mail.gmail.com> (raw)
In-Reply-To: <87a8mrvjrs.fsf@gnus.org>
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
On Tue, Feb 23, 2016 at 11:49 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> immerrr again <immerrr@gmail.com> writes:
>
> Could you repost the second patch?
>
Sure, attaching it.
Cheers,
immerrr
[-- Attachment #2: 0002-Prevent-infinite-loop-in-python-info-docstring-p.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]
From 149066dbfc7f11c40f6dbed70a3279153bf3ab7a Mon Sep 17 00:00:00 2001
From: immerrr <immerrr@gmail.com>
Date: Mon, 12 Oct 2015 14:17:16 +0300
Subject: [PATCH 2/2] Prevent infinite loop in python-info-docstring-p
python-info-docstring-p did not expect that
python-nav-beginning-of-statement could leave point intact not at the
beginning of buffer which happened if the first statement in the file
was indented (it is a Python syntax error).
* python.el (python-nav--forward-sexp): if backward-sexp brought point
to the beginning of the buffer, leave it there
---
lisp/progmodes/python.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6ff12b5..7ccd204 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1712,7 +1712,11 @@ expressions when looking at them in either direction."
(python-nav-beginning-of-block))
((memq context '(statement-start block-start))
(goto-char next-sexp-pos)
- (python-nav-beginning-of-statement))
+ (unless (bobp)
+ ;; If backward-sexp brought the point to
+ ;; beginning-of-buffer, beginning-of-statement
+ ;; will only bring it back.
+ (python-nav-beginning-of-statement)))
(t (goto-char next-sexp-pos))))))))))
(defun python-nav-forward-sexp (&optional arg safe skip-parens-p)
--
2.6.1
next prev parent reply other threads:[~2016-02-23 10:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 11:48 bug#21671: [PATCH] fix python.el hanging up during fontification #21657 immerrr again
2015-10-13 7:37 ` immerrr again
2015-10-13 8:43 ` Torsten Bronger
2015-10-13 8:56 ` immerrr again
2016-02-23 9:06 ` Lars Ingebrigtsen
2016-02-23 9:17 ` immerrr again
2016-02-23 9:49 ` Lars Ingebrigtsen
2016-02-23 10:00 ` immerrr again [this message]
2016-02-23 10:04 ` Lars Ingebrigtsen
2017-03-01 1:06 ` npostavs
2015-10-24 16:04 ` immerrr again
2016-02-07 11:44 ` immerrr again
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='CAERznn8G=_Snhk7eLVWEH68OcjPn1ARAZXpJSJSSgMwfXWBUMw@mail.gmail.com' \
--to=immerrr@gmail.com \
--cc=21671@debbugs.gnu.org \
--cc=larsi@gnus.org \
/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.