From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#55808: 29.0.50; If a Python class is on the first line, mark-defun does not mark the entire class Date: Sun, 5 Jun 2022 23:19:29 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5965"; mail-complaints-to="usenet@ciao.gmane.io" Cc: marcin borkowski To: 55808@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 05 16:21:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxr83-0001NE-Do for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 16:21:19 +0200 Original-Received: from localhost ([::1]:60372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxr82-0001aU-4F for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 10:21:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxr6r-0001ZO-3g for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 10:20:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxr6q-0001pT-Qw for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 10:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nxr6n-0002KI-MN; Sun, 05 Jun 2022 10:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: mbork@mbork.pl, bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jun 2022 14:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55808 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: marcin borkowski Original-Received: via spool by submit@debbugs.gnu.org id=B.16544387938920 (code B ref -1); Sun, 05 Jun 2022 14:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jun 2022 14:19:53 +0000 Original-Received: from localhost ([127.0.0.1]:33180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxr6f-0002Jn-8u for submit@debbugs.gnu.org; Sun, 05 Jun 2022 10:19:53 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxr6c-0002Jf-84 for submit@debbugs.gnu.org; Sun, 05 Jun 2022 10:19:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxr6b-0001Rb-6r for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 10:19:50 -0400 Original-Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:33374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxr6Z-0001dQ-Ev for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2022 10:19:48 -0400 Original-Received: by mail-ej1-x62e.google.com with SMTP id bg6so4603676ejb.0 for ; Sun, 05 Jun 2022 07:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=4ehxXIwdREUc9s+KugF/wHqE6qo6oc5mPBAMqLzEUN4=; b=OiAYDMF11qBf3cDcVOzW059nUfdm2QiB1j6gCOT2F7wCZHecO8WCAHci/eZkgqjCeY jnj5bYsAaLkx+vDzfoiCsaiwMxwPo1OMcGD+Th8KQl5MXQ0R6+JoKF7EqPie9lStaKrS PmhVpnUscDvE9AoPRFGWpoofiZU9LXp3qUX+ce/JY54bXBFrHovHvEXAaEZJga2sz0k6 Mzsw+pkgEFDVHWNEvMVYsyICFaEDLPh5Oa22ChAdVaG557ftEIpAXiTCpava8qA7tyoC 9x2IMxdlgW3Fgu7wSxHIYNYm1g5+55o6pvDeqV+F8Zu0VDkHW5EexeNCStghj9Ux74XW ydpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4ehxXIwdREUc9s+KugF/wHqE6qo6oc5mPBAMqLzEUN4=; b=Fu8fUHCeg+K+gBQPNVUjLNzr+co67iIXPDaX/1iTJks1k3kXFdztjV98KqaXfgZShS VFqpDyrx2K+0J7QIFg26/yqquEpJpZFn21c2IO4BQ8bnoTuu9CdjX/5kvnaxuwlI/Foi UyimIw5EBUN5jLhLrfwCrOrxxWidetAxHgvSyWGckr/l4jS+8Qp77Iux6UN1IWTTWqhK 1zDeK9noFBkTlzNgALT9wZy3doyXlmS3vb9JImZj1wrgG97+qsWcxM5Xqf/3VURxX6TX RxteMH8yYNQPoe1wkI0wggxLCraeJUpgHasUG8PQo8IYg2agDQOSUsATG3dp2jO5j7WD sBBg== X-Gm-Message-State: AOAM533189doOE+9fMyMlNopNAeSF3m++egLfvuWnuB+G2b5qf/0Dcj7 OexU6DqGhTUOfpaSv0sZZGA58ryWcgAfJnad9VdpIqu0 X-Google-Smtp-Source: ABdhPJwizkfU3H7ANvCkhu3XCjGB0yx+F5uCrZ6d6wtKh6/v0DVKL4M9MXwzl5Bd5DIT2Ln1byU9EQRgwiWFBy2vBbk= X-Received: by 2002:a17:906:1c04:b0:708:a007:5a77 with SMTP id k4-20020a1709061c0400b00708a0075a77mr17858309ejg.566.1654438783043; Sun, 05 Jun 2022 07:19:43 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=kobarity@gmail.com; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233721 Archived-At: X-Debbugs-CC: Marcin Borkowski Hi, The following steps will mark only the method baz, not the entire class Foo. 1. emacs -Q 2. Load the following Python file using M-x find-file #+begin_src python class Foo: def bar(): pass def baz(): pass #+end_src 3. M-x mark-defun This issue happens only if the class is on the first line of the file. The direct cause of this issue is the following condition in `mark-defun': #+begin_src elisp (= beg (point-min))) ; we were before the first defun! #+end_src This condition was introduced in Message #98 of Bug #21072. I understand that this is necessary to avoid marking the comment line like following: #+begin_src elisp ;; Comment header (defun func-1 (arg) "docstring" body) #+end_src However, I feel that this condition is too broad to test if "we were before the first defun". Any ideas? Best Regards, -- In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu) of 2022-06-05 built on ubuntu Repository revision: 6011d39b6a4bc659da364255bcae22c4e6ef3a3f Repository branch: master System Description: Ubuntu 22.04 LTS Configured using: 'configure --without-x --with-gnutls=ifavailable' Configured features: ACL LIBXML2 MODULES NOTIFY INOTIFY PDUMPER SECCOMP SOUND SQLITE3 THREADS XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media rmc puny dired dnd dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-mtn python json map comint regexp-opt ring cl-loaddefs cl-lib ansi-color seq term/screen term/xterm xterm gv subr-x byte-opt bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads inotify multi-tty make-network-process emacs) Memory information: ((conses 16 54149 7992) (symbols 48 6657 1) (strings 32 18794 1945) (string-bytes 1 610563) (vectors 16 10669) (vector-slots 8 126166 8797) (floats 8 26 262) (intervals 56 218 0) (buffers 992 12))