help-gnu-emacs
[Top][All Lists]
Advanced

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

python mode bugs


From: James K. Lowden
Subject: python mode bugs
Date: Thu, 5 Apr 2018 15:50:15 -0400

I have two problems with python.el.  Maybe three.  

1.  GNU bug report logs - #29717[1]: imenu does not recognize function
definitions with annotations.  

2.  imenu is purportedly bound to C-c C-j, but no "index" I supply
returns anything but errors.  What does it want?  

3.  At 111 days old, it doesn't seem like the known bug is getting any
attention.  What is the polite way to indicate it matters?  

In case you *really* want to help, the offending function appears to be 

        python-imenu--build-tree

and the regex

        python-nav-beginning-of-defun-regexp

The difference in the pattern to be matched is: 

        def f(a, b): #works
vs
        def f(a: int, b: str) -> bool: # fails

FWIW, I don't think the regex need include anything after the leading
parenthesis.  The following awk script is too simple because it doesn't
recognize nested functions and class methods, but otherwise does the
trick: 

        awk -F'[\t ()]' '/^def +/ {print $2}'

Any help much appreciated.  

--jkl
[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29717


reply via email to

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