From: Glenn Morris <rgm@gnu.org>
To: Alex Branham <alex.branham@gmail.com>
Cc: 29608@debbugs.gnu.org
Subject: bug#29608: python.el movement functions
Date: Fri, 08 Dec 2017 12:56:44 -0500 [thread overview]
Message-ID: <5refo5xfvn.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87vahigsa9.fsf@gmail.com> (Alex Branham's message of "Thu, 07 Dec 2017 15:08:30 -0600")
Alex Branham wrote:
> Python movement statements do not always result in the behavior I'd
> expect. Consider this python file (with (|) representing point):
>
> (|)for i in [1, 2, 3]:
> print(i)
>
> I'd expect M-x python-nav-forward-statement to result in
>
> for i in [1, 2, 3]:
> print(i)
> (|)
>
> but instead you wind up with
>
> for i in [1, 2, 3]:
> (|)print(i)
The actual result seems reasonable to me?
> and python-nav-forward-block (bound to M-e) is even worse. It results
> in point not moving at all:
>
> (|)for i in [1, 2, 3]:
> print(i)
It seems that you disagree with python.el's definition of "statement" and
"block". Eg the block definition seems to be:
(defconst python-rx-constituents
`((block-start . ,(rx symbol-start
(or "def" "class" "if" "elif" "else" "try"
"except" "finally" "for" "while" "with"
;; Python 3.5+ PEP492
(and "async" (+ space)
(or "def" "for" "with")))
symbol-end))
next prev parent reply other threads:[~2017-12-08 17:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 21:08 bug#29608: python.el movement functions Alex Branham
2017-12-08 17:56 ` Glenn Morris [this message]
2017-12-08 21:37 ` Alex Branham
2021-06-26 14:13 ` Lars Ingebrigtsen
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=5refo5xfvn.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=29608@debbugs.gnu.org \
--cc=alex.branham@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.