[Python-mode] lean navigation

Andreas Röhler andreas.roehler at online.de
Sat Dec 29 06:01:33 EST 2018


Hi all,

when a class has a large amount of defs inside, jumping to the end of
class might take some noticeable time. (Albeit don't see a bug report so
far.)

For now, navigating Python source internally is done by
‘py-forward-statement’ resp. ‘py-backward-statement’ - where
‘statement’ means just ‘section of code starting at its own indent’.
While this seems complete and reliable, it does several checks we
might get rid off in certain circumstances when speed matters.

For example when jumping to the end from a known block-start, may
reason from the current indentation: any further start lesser/equal
indented can't be part of.

This makes some assumptions WRT formatting and might fail in case of
uncommon or mixed formats using semicolons for example. As it's about
an editor here and not about a lexer/parser IMO the change might be
worth it. OTOH: how often exist these large classes?

Maybe have a customizable boolean py-use-speed-navigation-p?
Just a RFC,

Cheers,
Andreas





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-mode/attachments/20181229/d0cc0c41/attachment.html>


More information about the Python-mode mailing list