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 #14 received at submit <at> debbugs.gnu.org (full text, mbox):
Am 25.06.2015 um 18:46 schrieb Rasmus:
> Hi,
>
> Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:
>
>>> 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.
> That is probably true. I really just want to be able to bent python.el to
> work with my internal "fast" logic which controls how I type on keyboard.
>
>>> and I know that the behavior
>>> isn't wrong.
>> It behaves arbitrary WRT Python syntax, that's wrong.
> OK. I'm not sure. I can somehow imagine parentheses that would justify
> the movements cf. below. But in lisp it would not go from one "nesting"
> to another, which is essentially what bugs me.
>
>
>> 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.
> I'm not sure I understand.
>
> The way I think about it is like the following. If I'm at point 2 and
> move backward I really want to be a point 1.
Don't think so WRT picture below. From end of symbol "defun" it move
back to beginning "d".
Because "defun" is an element of the list.
Next C-M-b should go up backward - but fails. A design flaw IMO.
> But in python point 0 and 1
> is the same, so it assumes the outer level which has end point 4. But I
> at most want to go to point 3, closing the "nearest" "sexp".
>
> 01 2 3
> vv v V
> ((defun name (arg))
> ...)
> ^
> 4
>
> Rasmus
>
Not sure if I understand the double paren at picture. Rules are simple
anyway: Either there is an element of same level, reach that. Or go up.
Or go the end.
You could try py-forward-expression, py-backward-expression.
Just to study the behavior.
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.