GNU bug report logs -
#24820
Imenu in `python-mode' does not display function name for async def
Previous Next
Reported by: Dmitry Lazurkin <dilaz03 <at> gmail.com>
Date: Sat, 29 Oct 2016 20:02:02 UTC
Severity: minor
Tags: fixed, patch
Merged with 25734
Found in version 25
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
Message #63 received at control <at> debbugs.gnu.org (full text, mbox):
unarchive 24820
forcemerge 24820 25734
quit
Michael Kleehammer <michael <at> kleehammer.com> writes:
> This patch is for python mode. Recently Python 3 added the “async”
> keyword for functions like so:
>
> def this_is_not_async():
> pass
>
> async def this_is_async():
> pass
>
> The mode has already been updated to recognize this for most things,
> but not imenu. It currently would show:
>
> this_is_not_async (def)
> def (async)
>
> The patch below is a minor modification for a regular expression. The
> old one simply took the 2nd token on the line to be the name; the new
> one skips the optional “async” keyword.
As far as I can tell, your patch has no effect on imenu, after applying
it and doing M-x imenu RET TAB, I get this *Completions* buffer:
Click on a completion to select it.
In this buffer, type RET to select the completion near point.
Possible completions are:
*Rescan*
def.(async)
this_is_not_async.(def)
Since the patch in #24820 does fix the problem, I'm merging this bug
into that one.
> Please note the current imenu is unusable in a file with a lot of
> async functions - it would be nice if this rolled out with 25.2 if
> possible, which I believe adds the rest of async support.
AFAIK, it's too late to fix non-critical bugs in emacs-25, but python.el
is both in Emacs "core" and a GNU ELPA package, so you can install the
version from master using package.el (when we bump its package version,
that is).
This bug report was last modified 8 years and 95 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.