unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: 20897@debbugs.gnu.org
Subject: bug#20897: 25.0.50; [python] sexp-movement are confusing
Date: Thu, 25 Jun 2015 18:16:43 +0200	[thread overview]
Message-ID: <558C296B.7030807@easy-emacs.de> (raw)
In-Reply-To: <87616blr7a.fsf@gmx.us>


Am 25.06.2015 um 17:53 schrieb Rasmus:
> Hi,
>
> Sexp movement in python.el are very confusing to me.  I know that logical
> sexp movements outside lisp are subjective,

Not more as anything else editor-related. Languages are composed by 
elements, which a syntax may describe. Even if an editor must not be the 
slave of a syntax, it should be aware of.


>   and I know that the behavior
> isn't wrong.

It behaves arbitrary WRT Python syntax, that's wrong.

>   I understand why it does what it does.  The behavior is just
> confusing when I use it an practice.
>
> Example, starting from emacs -q:
>
> Open test.py
>
> Insert something like this, ignoring point denoted by "{v,^} {1,...,5}".
>
> 4  5   6
> v  v   v
> def foo(x):
>     """return x as one"""
>
>      x = 1;
>
>      return(x)
>     ^      ^  ^
>     2      3  1
>
> Consider points 1,...,5.  At point 2 forward-sexp will go to point 1, at
> point 3 backward-sexp will go to point 2.  At point 1, sexp-backward will
> go to 4 rather than point 2 (as I would expect).  Likewise, at point 4,
> forward sexp goes to point 1 rather than 5.  At point five, everything is
> as I would expect, and {forward,backward}-sexp goes to 6 and 4.
>
> A switch to prefer a closer opening/closing of the "sexp" at point would
> be great.
>
> Thanks,
> Rasmus
>

[ ... ]

Python is composed by expressions.
If inside an expression C-M-f should to to its end.

 From end to next end same level if existing - or level up, or next 
top-level-form, or nil at EOB

Backward and forward needs to be consistent.







  reply	other threads:[~2015-06-25 16:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 15:53 bug#20897: 25.0.50; [python] sexp-movement are confusing Rasmus
2015-06-25 16:16 ` Andreas Röhler [this message]
2015-06-25 16:46   ` Rasmus
2015-06-25 17:23     ` Andreas Röhler
2015-06-26  1:48   ` Stefan Monnier
2015-06-26  2:03     ` Daniel Colascione
2015-06-26  4:19       ` Stefan Monnier
2015-06-26  6:02       ` Andreas Röhler
2015-06-26  6:17       ` Andreas Röhler
2022-02-03 21:11 ` Lars Ingebrigtsen
2022-02-03 23:22   ` Kévin Le Gouguec

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=558C296B.7030807@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=20897@debbugs.gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).