GNU bug report logs - #13642
24.3.50; python-nav-backward-sexp mishandles string movement

Previous Next

Package: emacs;

Reported by: Jorgen Schaefer <forcer <at> forcix.cx>

Date: Wed, 6 Feb 2013 23:53:02 UTC

Severity: normal

Found in version 24.3.50

Done: Fabián Ezequiel Gallina <fabian <at> anue.biz>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: 13642 <at> debbugs.gnu.org
Subject: bug#13642: 24.3.50; python-nav-backward-sexp mishandles string movement
Date: Wed, 15 May 2013 07:55:51 +0200
Am 07.02.2013 01:12, schrieb Daniel Colascione:
> On 2/6/2013 3:50 PM, Jorgen Schaefer wrote:
>> Hello!
>> In python-mode, I get the following behavior (with _|_ being point):
>>
>> -----
>> def foo():
>>      bar = "bar"
>>      baz = "baz"_|_
>>
>> =>
>>
>> _|_def foo():
>>      bar = "bar"
>>      baz = "baz"
>> -----
>
> That's by design. python-mode tries to emulate lisp movement as much as
> possible, so it considers point to be at the end of a "defun" and tries to skip
> over the entire "defun", back to the beginning.
>
> This functionality appears to be buggy:
>
> def foo():
>      bar = "bar"
>      baz = "baz"
>      x=x()_|_
>
> =>
>
> def foo():
>      bar = "bar"
>      baz = "baz"
>      x=x_|_()
>
> I also find the behavior more counter-intuitive than useful, and I wish
> python-mode acted more like cc-mode here.
>


[ ... ]

hmm, din't think so. In Python that point indicates the end of assignment
baz = "baz"

End of defun is reached with following dedent only.

So the OP's expection seems wrong too:

backward-sexp must reach the beginning of the assigment "baz =..."

BTW in python-mode.el we have py-beginning-of-expression for the OP's want.

Cheers,

Andreas






This bug report was last modified 12 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.