GNU bug report logs - #36700
27.0.50; python-mode beginning-of-defun broken

Previous Next

Package: emacs;

Reported by: Yilin Wei <yilin.wei10 <at> gmail.com>

Date: Wed, 17 Jul 2019 00:44:02 UTC

Severity: minor

Tags: notabug

Found in version 27.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 36700 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Yilin Wei <yilin.wei10 <at> gmail.com>
Cc: 36700 <at> debbugs.gnu.org
Subject: Re: bug#36700: 27.0.50; python-mode beginning-of-defun broken
Date: Tue, 16 Jul 2019 20:49:37 -0400
Yilin Wei <yilin.wei10 <at> gmail.com> writes:

> def moo():
>     class Test:
>       pass
>     <-
>
> When the cursor is at the location marked, running (beginning-of-defun)
> makes the cursor go to the wrong location, shown below, instead of to
> the beginning of the def.
>
> def moo():
> <-   class Test:
>        pass

I don't think this is a bug, python.el just takes a more liberal
interpretation of "defun" that includes class definitions.  See for
example, python-nav-beginning-of-defun-regexp:

    (defvar python-nav-beginning-of-defun-regexp
                                    ^^^^^^^^^^^^
      (python-rx line-start (* space) defun (+ space) (group symbol-name))
      "Regexp matching class or function definition.
                       ^^^^^^^^^^^^^^^^^




This bug report was last modified 4 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.