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: Andreas Röhler
Subject: Re: Python interactive navigation around nested functions
Date: Tue, 21 Jun 2016 08:26:35 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0



On 21.06.2016 07:45, Dima Kogan wrote:
Stefan Monnier <address@hidden> writes:

         def wwrap(f):
             print 'Inside wwrap()'
             def wrapped_f(*args):
                 print 'Inside wrapped_f()'
                 print 'Decorator arguments:', arg1, arg2, arg3
                 f(*args)
                 print 'After f(*args)'
             return wrapped_f
         return wwrap

Traditionally (IMO), C-M-a goes to the nearest beginning of defun at the
same AST level or higher.  So from "return wrapped_f", it seems reasonable
to jump to "def wrapped_f(*args):".
Hmmm. That's not at all how I always thought this was supposed to work,
but I actually see this behavior in several modes across several
languages,

Thats because of bugs in lisp mode WRT beginning-of-defun --cherished for decades-- it can't be done right that way. From there the bad manner might have expanded.

Tried to fix that in lisp-mode here:

https://github.com/andreas-roehler/werkstatt/blob/master/subroutines/gnu-emacs-fixes.el



  so it looks like you're right. I don't really LIKE it,
though, so let me ponder.

Thanks for setting me straight





reply via email to

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