emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix python-info-current-defun performance for large defuns


From: kobarity
Subject: Re: [PATCH] Fix python-info-current-defun performance for large defuns
Date: Sat, 16 Sep 2023 23:51:56 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Tom Gillespie wrote:
> Here's an updated patch with the fix and additional test for the
> case kobarity identified. I also shortened the long lines. Best!

Thank you for the updated patch.  However, there still seems to be a
bit of a problem.

def a():
    def b(): return
    if 1:
        def c(): return
        z = 1

When the point is at the "z = 1" line, python-info-current-defun
should return "a", but the new function returns nil.

I also noticed another subtle difference in behavior with the example
added as an ERT:

def a():
    def b(): return
    if 1:
        def c(): return

if 2:
    if 3:
        def d(): return

If the point is on the empty line above "if 2:", the new function
returns "a", while the current function returns nil.



reply via email to

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