GNU bug report logs -
#20897
25.0.50; [python] sexp-movement are confusing
Previous Next
Reported by: Rasmus <rasmus <at> gmx.us>
Date: Thu, 25 Jun 2015 15:55:02 UTC
Severity: minor
Found in version 25.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
This bug report was last modified 3 years and 167 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.