emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python interactive navigation around nested functions


From: Stefan Monnier
Subject: Re: Python interactive navigation around nested functions
Date: Tue, 21 Jun 2016 02:21:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> 1. If we're on a function-definition line, C-M-a should go up to the
> previous definition, at the SAME OR HIGHER AST level

OK, that's what it's supposed to be already.

> 2. If we're NOT on a function-definition line, C-M-a should go up to the
> previous definition, at a HIGHER AST level.

That's a significant change.  It means that if we're between two
functions (e.g. on a static var declaration in a C file), C-M-a would
jump to BOB.

> From any of the "print 55" lines, C-M-h selects the whole "def ddd"
> block, which I would not expect at all. If the ddd block isn't there,
> then it selects all of the "ccc" block, which is wrong too: neither of
> these contain the statement we started on. One could call this a
> separate bug from the original complaint, but changing the C-M-a
> definition makes this work naturally.

These behaviors are indeed problematic (AFAICT they're plain bugs w.r.t
the behavior described in the docstring), but they affect C-M-h, so
hopefully we can fix them in C-M-h without having to change C-M-a.

Of course by C-M-a we can mean different things:
- the backend navigation code provided by the major mode via
  *-of-defun-function.
- the command bound to C-M-a.
- the beginning-of-defun command.

They don't do exactly the same thing either, and the constraints w.r.t
changing them are slightly different (e.g. some allow the introduction
of a whole new backend API, or the rebinding of C-M-a to another command).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]