From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 16 20:43:45 2019 Received: (at submit) by debbugs.gnu.org; 17 Jul 2019 00:43:45 +0000 Received: from localhost ([127.0.0.1]:51379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnY2q-0001CS-R6 for submit@debbugs.gnu.org; Tue, 16 Jul 2019 20:43:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:35462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnXM8-0004Jy-NB for submit@debbugs.gnu.org; Tue, 16 Jul 2019 19:59:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40511) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnXM7-0002rG-Mu for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 19:59:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnXM6-0005ua-SS for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 19:59:35 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:44173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnXM6-0005tT-K2 for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 19:59:34 -0400 Received: by mail-io1-xd31.google.com with SMTP id s7so42805957iob.11 for ; Tue, 16 Jul 2019 16:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=YKVSAlBgWeraCsHpKPLzOHOuM4be+KnWva8p8bnTE9g=; b=YDE5u29m8EZkRjM1+RrzRAbW9NpNwKeDw1Q61qf5d4fHmXFVKAEnbr7HqsBJkG60JV r/U+CFjg6ib41yGA5G1luryNxAxzP0Vz2Td5fTv6khhvOmZd+Z6CEB8hizi9TrIRf8OH V5cVa9LZoj6g3OlwW1oJnMtco8DGx9k4ZF6ZoTpKH+H+c92GTGrWAyhc0FvAsfFasR1l 0BvsJJjJhY05KuONlZK6iSEwBoq2mkR8QjsskuT2abdT6xcFtietX4vI2Tu8hRfPOw2P Sjg9GoQC/9SOYCLe+Id20RksY6I/Hh1MBfihlJaGwmf6unRnC8gJmNuTIRnjXKTunsUf R0Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YKVSAlBgWeraCsHpKPLzOHOuM4be+KnWva8p8bnTE9g=; b=DX9fo5pBsC+d56Y4v3ofGWnjsupHkfS1SNCOoWf4+Qs9fOedUsWvI7bkXOZcubOiPR 9y+ZANsRRGJSeX0PCvN41KfrA60q7h644XGmV+oONlU0uNMitOPwHyqEL16u0DqbmmgD o7BXZHzx89yyFQeiT9SLcSaTj7aefuosTqOxsX1bM3LvlqxlOC0v/ERyppTw3cdeNpF2 sH/Vq/mtC188JABOzf8p23auVoaUoC2nGdRbPn0oSWi140Yynd3xK0S3JrfnGQzgVWIe quAJF6FobJsVVIj38E+gr5cT7fziRrzrTIKI6jjJCiZUIfQmramN6Uy9lCQMr+icSVlP 5l3g== X-Gm-Message-State: APjAAAUw373fYWo8FjDRooaILY/AV9KI80eMMVOhTDJdjxNwgPwbq1rl F1CHfdAm4VsVAOjwwj/WMeSscPpbf6x+q8DsJB28ckIX X-Google-Smtp-Source: APXvYqzwcWtOD5no69OYpN0REabxS4CFlKUzwQFXQug2wpGmYyw74da5thUI9pPYtBuVeizvT2BdgICEOHJeaNZ+WO0= X-Received: by 2002:a5e:9308:: with SMTP id k8mr33211739iom.143.1563321572107; Tue, 16 Jul 2019 16:59:32 -0700 (PDT) MIME-Version: 1.0 From: Yilin Wei Date: Wed, 17 Jul 2019 00:59:38 +0100 Message-ID: Subject: 27.0.50; python-mode beginning-of-defun broken To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000f9ae3a058dd52a7a" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d31 X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 16 Jul 2019 20:43:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --000000000000f9ae3a058dd52a7a Content-Type: text/plain; charset="UTF-8" Hi, The function `beginning-of-defun` seems to be be broken if there is a nested class definition in the function. I think this also means that `(thing-at-point 'defun)` isn't working as expected. Behaviour: 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 Yilin --000000000000f9ae3a058dd52a7a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Hi,

The function `beginning-of-defun` seems= to be be broken if
there is a nested class definition in the function.<= br>
I think this also means that `(thing-at-point 'defun)` isn't= working
as expected.

Behaviour:

def moo():
=C2=A0 =C2= =A0 class Test:
=C2=A0 =C2=A0 =C2=A0 pass
=C2=A0 =C2=A0 <-
=C2= =A0 =C2=A0
When the cursor is at the location marked, running (beginnin= g-of-defun)
makes the cursor go to the wrong location, shown below, inst= ead of to
the beginning of the def.

def moo():
<- =C2=A0 cl= ass Test:
=C2=A0 =C2=A0 =C2=A0 =C2=A0pass

Yilin
--000000000000f9ae3a058dd52a7a-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 16 20:49:48 2019 Received: (at 36700) by debbugs.gnu.org; 17 Jul 2019 00:49:48 +0000 Received: from localhost ([127.0.0.1]:51384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnY8i-0001N4-Je for submit@debbugs.gnu.org; Tue, 16 Jul 2019 20:49:48 -0400 Received: from mail-io1-f46.google.com ([209.85.166.46]:44815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnY8g-0001Mm-8T for 36700@debbugs.gnu.org; Tue, 16 Jul 2019 20:49:46 -0400 Received: by mail-io1-f46.google.com with SMTP id s7so42962730iob.11 for <36700@debbugs.gnu.org>; Tue, 16 Jul 2019 17:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=okEp9r6Je5LdnmtcA7ek3qJicd8rP6EhhTgO33IosVg=; b=seQSEsNeiNMfn0jvkW+EsciFZlha4J8fFrLQBdSWkncURkQGMit9td7JahsqaGstcO BrL8unkG7XxEj/hbrIbGPDCyigo4zn/S4QCDagBwiGp2MVhhdsKBiIJV5JGabzCIGQux sLBtPK6eKVH5CfrDTCR6w8wZ86pFO7dVu+HQdNHAUxUfr2H7lcH6fLQcGi9zr+JOTbD2 VCs9kPNfYlz493tRmZzcW5XPB4d/o+mwa14+FUTkeDlsLzqAHcOHnOUox3wjogG+/L26 yU6gDSTwPk6WjF5EkyOG3MaX55t4pPqzbBw3Gb/F3H8z5cmU6zp7w/5N/d0c0LjXDCKO zXwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=okEp9r6Je5LdnmtcA7ek3qJicd8rP6EhhTgO33IosVg=; b=rKilY+MXzIy8GgaLuOA2pq+MZa3IGYpVdyFWduDlfOJswZo5occlVhpn2SOJSkL/oO 0JR9ZA6g/ZnxuRGRvgpV02kN58zoYJx9nLxm4otot+9tEaNVIPQiYqJpxOlm2JjgLtOy +s1qPav6MhPJoJJdPMZmslTAFJP5bm+UP/YDcH7TuKDSIilGcRCtokDoiw888Pnw5UmO qFDtmosCN/zWfRC+sCSKGQppq/rcQy8H2SA+zRczYgFx+zbzMD2LhySvGU0uT3FtzI4E y7KBQtNAHnt6G6whNs+aHt+C0Mk50Gn6bGXcPRLXc3+86VPpZqQ1uCs+nnnkYHl6JVo1 pJxA== X-Gm-Message-State: APjAAAXBGx+lJyN2k1eu0fSz1Gp8ddjC2RjDLDE+VKRwuOSuQ+tZpXVj QqUcthP4GQPGo3ykx0RILNi0U5Q0 X-Google-Smtp-Source: APXvYqxusHD1ZJHOQ1Gr4q5wDVD3Up1g4HS2QBEC85iCCA9PzcInZTx7SDwFQWPe/XZ+LEoDNMwLRg== X-Received: by 2002:a05:6638:149:: with SMTP id y9mr38269162jao.76.1563324579114; Tue, 16 Jul 2019 17:49:39 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id e84sm28021277iof.39.2019.07.16.17.49.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jul 2019 17:49:38 -0700 (PDT) From: Noam Postavsky To: Yilin Wei Subject: Re: bug#36700: 27.0.50; python-mode beginning-of-defun broken References: Date: Tue, 16 Jul 2019 20:49:37 -0400 In-Reply-To: (Yilin Wei's message of "Wed, 17 Jul 2019 00:59:38 +0100") Message-ID: <87ef2pzdr2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36700 Cc: 36700@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yilin Wei 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. ^^^^^^^^^^^^^^^^^ From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 25 20:26:09 2020 Received: (at 36700) by debbugs.gnu.org; 26 Aug 2020 00:26:09 +0000 Received: from localhost ([127.0.0.1]:36643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAjGS-0007TM-Ud for submit@debbugs.gnu.org; Tue, 25 Aug 2020 20:26:09 -0400 Received: from mail-yb1-f169.google.com ([209.85.219.169]:46565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAjGQ-0007Sq-1R for 36700@debbugs.gnu.org; Tue, 25 Aug 2020 20:26:07 -0400 Received: by mail-yb1-f169.google.com with SMTP id x10so238025ybj.13 for <36700@debbugs.gnu.org>; Tue, 25 Aug 2020 17:26:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=UTPlWQ3z3TatEfu8mX/fvQKU0JGCUmfjUiUdu9JID3A=; b=PcpQoJ/Cg7ffUSKkdmTtAffrr3zo90eW7ZOqnlf1ThJ5BpP+WUFGp5Ahczb79WxA/3 cv7KzjWIxGhMfAetvFLs80Fg+NzoC5H1A+Tyx698byoD+a5gQBTSHGNm2O6dA/KlAlH8 UuRieptdDWBY9IpFGZj7aiqVMg5kXiBQdOm5CvG921BlqDcQrD494Mdz2c9nGdu3vPN3 962gcvxHMLha2jwZl7zXmtzWnjX84C4gaTL6MAT4rQ0Bgb9miWhjVhr+o6RFOVl6GlDI sZLuBzJ0HEjjG4bSduO+bYQgffKo7DDDQokbeZMSJb4fV+DbnvrH3LkjyAIy/ytaQ9LP Vk0w== X-Gm-Message-State: AOAM530m4uvCtevU+TfOplWHXT/k9R6GorKj/3WuImicxaHYkYfoKttf jL/DMaPkziWhQt9qn5rTxrQKEJI73Abymr/C+cQ= X-Google-Smtp-Source: ABdhPJwjFXVtKaTH9yG/fZwqE99YzuFG/N1PIu2VXH0s9RRIV6ho4PLYOgS5Ar94IvalcMj5AOK9+H7CYJUnp6Hijyw= X-Received: by 2002:a25:b290:: with SMTP id k16mr17678787ybj.389.1598401560618; Tue, 25 Aug 2020 17:26:00 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 25 Aug 2020 17:26:00 -0700 From: Stefan Kangas In-Reply-To: <87ef2pzdr2.fsf@gmail.com> (Noam Postavsky's message of "Tue, 16 Jul 2019 20:49:37 -0400") References: <87ef2pzdr2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Tue, 25 Aug 2020 17:26:00 -0700 Message-ID: Subject: Re: bug#36700: 27.0.50; python-mode beginning-of-defun broken To: Noam Postavsky Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 36700 Cc: Yilin Wei , 36700@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) tags 36700 + notabug close 36700 thanks Noam Postavsky writes: > Yilin Wei 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. > ^^^^^^^^^^^^^^^^^ I agree with Noam here, and seeing as there has been no further replies within 1 year, I'm therefore closing this bug report. From unknown Tue Jul 08 11:10:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Sep 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator