From unknown Fri Jun 20 07:22:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13438 <13438@debbugs.gnu.org> To: bug#13438 <13438@debbugs.gnu.org> Subject: Status: 24.2.92; Infinite loop in python imenu support Reply-To: bug#13438 <13438@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:22:05 +0000 retitle 13438 24.2.92; Infinite loop in python imenu support reassign 13438 emacs submitter 13438 Ivan Andrus severity 13438 important thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 14 15:59:38 2013 Received: (at submit) by debbugs.gnu.org; 14 Jan 2013 20:59:38 +0000 Received: from localhost ([127.0.0.1]:60330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tur86-000540-8N for submit@debbugs.gnu.org; Mon, 14 Jan 2013 15:59:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42360) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tur83-00053t-QY for submit@debbugs.gnu.org; Mon, 14 Jan 2013 15:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tur7c-0005pk-Qt for submit@debbugs.gnu.org; Mon, 14 Jan 2013 15:59:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:36962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tur7c-0005pc-O1 for submit@debbugs.gnu.org; Mon, 14 Jan 2013 15:59:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tur7b-0005E1-CT for bug-gnu-emacs@gnu.org; Mon, 14 Jan 2013 15:59:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tur7a-0005kd-0P for bug-gnu-emacs@gnu.org; Mon, 14 Jan 2013 15:59:07 -0500 Received: from mail-bk0-f49.google.com ([209.85.214.49]:37162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tur7Z-0005hm-Kx for bug-gnu-emacs@gnu.org; Mon, 14 Jan 2013 15:59:05 -0500 Received: by mail-bk0-f49.google.com with SMTP id jm19so2275444bkc.36 for ; Mon, 14 Jan 2013 12:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version:x-mailer; bh=Fx0UZR5DQOMRQybCs1rq2i8FhtvlTZwy2+asZd6qLkc=; b=B15SaLB6CZOHKCJqQZFw7AOqPYTssQXOtYXehS31gIA+arZgQQ0kO/g6nTn+0IgQKg UBJkIU6YvOwaxRMWVfxT4lPcXsX580AtuYC+Shmf+/u+L/05tv8PSG87hW+9PQ0k1XLj uzAVq7+d+JruEL925ob8Lk2pMnDGHhF+AnaIjB2MQVFICQ65Wgdr71BNVAc/fMMxANUw QFroCIcZ+zG8PkSZ838z7Es6IMG83aq1wPtgEqkZWkHEVobr0dF3gQa4hQ+1SyjS+osl pz0HLTxtwLpcvYgff/brHBErpeNUKTg1qhIMg6zphjLYMpR21VmKIt7Hr2TPtOX3B2ZO Jc8g== X-Received: by 10.204.12.202 with SMTP id y10mr40908574bky.51.1358197143861; Mon, 14 Jan 2013 12:59:03 -0800 (PST) Received: from [10.0.2.25] (catv-80-99-48-145.catv.broadband.hu. [80.99.48.145]) by mx.google.com with ESMTPS id hm8sm11159186bkc.10.2013.01.14.12.59.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jan 2013 12:59:03 -0800 (PST) From: Ivan Andrus Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 24.2.92; Infinite loop in python imenu support Message-Id: <1AEAF732-314C-4E90-8F48-DAA237551495@gmail.com> Date: Mon, 14 Jan 2013 21:59:01 +0100 To: "bug-gnu-emacs@gnu.org" Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) X-Mailer: Apple Mail (2.1499) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) The following happens on the Emacs 24 branch as well as trunk. =46rom `emacs -Q` In a new python buffer, insert=20 def bob(): return 3 and position the cursor before def. Then run M-x imenu, and you get the message=20 imenu-default-create-index-function: Infinite loop at = *scratch*:1:imenu-prev-index-position-function does not move point -Ivan In GNU Emacs 24.2.92.1 (i386-apple-darwin12.2.0, NS = apple-appkit-1187.34) of 2013-01-14 on oroszlan.local Bzr revision: 111176 jan.h.d@swipnet.se-20130113193605-626pw01y497yubsc Windowing system distributor `Apple', version 10.3.1187 Configured using: `configure '--with-ns'' Important settings: value of $LC_CTYPE: UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Python Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: d e f SPC b o b , , ( ) : =20 s-x C-g M-x p y t h =20 SPC SPC SPC d r e t u r n SPC 5 =20 C-a C-k C-k C-k C-k C-k=20 C-k C-k C-h k =20 M-x i m e M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. kill-region: The mark is not set now, so there is no region Quit python-indent-line: Arithmetic error [4 times] byte-code: Beginning of buffer python-indent-line: Arithmetic error [2 times] Type C-x 1 to delete the help window, C-M-v to scroll help. python-indent-line: Arithmetic error [2 times] imenu-default-create-index-function: Infinite loop at *scratch*:1: = imenu-prev-index-position-function does not move point Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils imenu help-fns help-mode python rx easymenu comint ring ansi-color time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 20 22:02:39 2013 Received: (at 13438) by debbugs.gnu.org; 21 Jan 2013 03:02:39 +0000 Received: from localhost ([127.0.0.1]:42147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tx7eg-0004QM-Uj for submit@debbugs.gnu.org; Sun, 20 Jan 2013 22:02:39 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:36246) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tx7ee-0004QF-Ng for 13438@debbugs.gnu.org; Sun, 20 Jan 2013 22:02:37 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Tx7df-0007g6-0O; Sun, 20 Jan 2013 22:01:35 -0500 From: Glenn Morris Subject: Re: bug#13438: 24.2.92; Infinite loop in python imenu support References: <1AEAF732-314C-4E90-8F48-DAA237551495@gmail.com> to: Fabian Ezequiel Gallina X-Spook: United Nations Maple Comirex Rand Corporation benelux X-Ran: CX9 (Ivan Andrus's message of "Mon, 14 Jan 2013 21:59:01 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 13438 Cc: Ivan Andrus , 13438@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Hi, could you look at this report please? http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13438 Ivan Andrus wrote: > The following happens on the Emacs 24 branch as well as trunk. > > From `emacs -Q` > > In a new python buffer, insert > > def bob(): > return 3 > > > and position the cursor before def. Then run M-x imenu, and you get the > message > > imenu-default-create-index-function: Infinite loop at *scratch*:1:imenu-prev-index-position-function does not move point > > -Ivan > > > In GNU Emacs 24.2.92.1 (i386-apple-darwin12.2.0, NS apple-appkit-1187.34) > of 2013-01-14 on oroszlan.local > Bzr revision: 111176 jan.h.d@swipnet.se-20130113193605-626pw01y497yubsc > Windowing system distributor `Apple', version 10.3.1187 > Configured using: > `configure '--with-ns'' > > Important settings: > value of $LC_CTYPE: UTF-8 > locale-coding-system: utf-8-unix > default enable-multibyte-characters: t > > Major mode: Python > > Minor modes in effect: > tooltip-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > > Recent input: > d e f SPC b o b , , ( ) : > s-x C-g M-x p y t h > SPC SPC SPC d r e t u r n SPC 5 > C-a C-k C-k C-k C-k C-k > C-k C-k C-h k > M-x i m e M-x r e p o r rn> > > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > kill-region: The mark is not set now, so there is no region > Quit > python-indent-line: Arithmetic error [4 times] > byte-code: Beginning of buffer > python-indent-line: Arithmetic error [2 times] > Type C-x 1 to delete the help window, C-M-v to scroll help. > python-indent-line: Arithmetic error [2 times] > imenu-default-create-index-function: Infinite loop at *scratch*:1: imenu-prev-index-position-function does not move point > > Load-path shadows: > None found. > > Features: > (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml > mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev > gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util > mail-prsvr mail-utils imenu help-fns help-mode python rx easymenu comint > ring ansi-color time-date tooltip ediff-hook vc-hooks lisp-float-type > mwheel ns-win tool-bar dnd fontset image regexp-opt fringe > tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow > timer select scroll-bar mouse jit-lock font-lock syntax facemenu > font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan > thai tai-viet lao korean japanese hebrew greek romanian slovak czech > european ethiopic indian cyrillic chinese case-table epa-hook > jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces > cus-face macroexp files text-properties overlay sha1 md5 base64 format > env code-pages mule custom widget hashtable-print-readable backquote > make-network-process ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 16:58:53 2013 Received: (at 13438) by debbugs.gnu.org; 23 Jan 2013 21:58:53 +0000 Received: from localhost ([127.0.0.1]:46830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty8LN-0001GD-AT for submit@debbugs.gnu.org; Wed, 23 Jan 2013 16:58:53 -0500 Received: from mail-yh0-f51.google.com ([209.85.213.51]:38761) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty8LL-0001G6-Au for 13438@debbugs.gnu.org; Wed, 23 Jan 2013 16:58:52 -0500 Received: by mail-yh0-f51.google.com with SMTP id q1so158642yhf.38 for <13438@debbugs.gnu.org>; Wed, 23 Jan 2013 13:57:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=6eLAkbLup9B2zuiT4mV27dVthWQHGquTFEUB40XluR4=; b=VwNkHytW/UE3i5iqO5EkHMV9Ovenbc6s8ejdzh8X9K3Icxcum9H7OfIA9CmOXTNn7n NUqrIktkISaWpZ5gJyQJy0zr4lEPqLNjFJsob8lsHi8vpy7D5/UsH6hNXL57GJpXfiZL pZokZCWpay9U8senbTeXvo4XKb1yaf9HfLDKgTGAXBig428SFDJGFgN2mo8rX7sFl9p8 Z4Pmo6wZrLaeGbRqVufgu06SEEOwkQ55sesVE6br3Uxuor96u+N6quUblkGQdi5gwwbN M9YgcCufHIp2LELRsY1kLjeJFk+WsEht4rxOIvGi5P6qy6VkSnkAcCM2QzNU2e69KqCZ b3mQ== X-Received: by 10.236.116.135 with SMTP id g7mr3138421yhh.85.1358978253740; Wed, 23 Jan 2013 13:57:33 -0800 (PST) Received: from [192.168.1.102] ([190.192.49.157]) by mx.google.com with ESMTPS id d17sm12012331ann.11.2013.01.23.13.57.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 13:57:33 -0800 (PST) Message-ID: <51005D1E.1060401@anue.biz> Date: Wed, 23 Jan 2013 18:58:54 -0300 From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: 13438@debbugs.gnu.org Subject: 24.2.92; Infinite loop in python imenu support Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlt4eTcIryTy02AZaz4NVQEaW0Wenx3y8WgQiucodkiGrfqfS0kgn8PrfY26+lJE0SkHsfB X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13438 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Fixed in revno 111196 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 17:00:13 2013 Received: (at control) by debbugs.gnu.org; 23 Jan 2013 22:00:13 +0000 Received: from localhost ([127.0.0.1]:46834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty8Mf-0001JH-2G for submit@debbugs.gnu.org; Wed, 23 Jan 2013 17:00:13 -0500 Received: from mail-yh0-f51.google.com ([209.85.213.51]:45242) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty8Md-0001JB-DT for control@debbugs.gnu.org; Wed, 23 Jan 2013 17:00:11 -0500 Received: by mail-yh0-f51.google.com with SMTP id q1so155868yhf.24 for ; Wed, 23 Jan 2013 13:58:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to :content-type:content-transfer-encoding:x-gm-message-state; bh=ZMXL9FIwwKOUPFWZ7fbjLlA5jpYQZy4/HgRVi0YqVP4=; b=aeMTzq4It8/K1jHSsQPL0sKIlF2SIS4U28GL2w0wQSyyusqt1Vsb0EPhLZXdX0uwiZ VtrXrD9kFH7YHeqXhdOXuEYJdl/oIXwCu2Jb1vwFw5uMZjYb0JzbOWqvRXnWGacb8Opa BFYJO7KpC19I2hirDF9y3I46isuYyHxbQCoy2uhKkwRPxqsvkoNQNVYnfwmLVf3YEGaP zp4RoacdJbitxZ158Y1Lo1KSqbXqD+hDu6MGtcG+/5Loi1ipvOQhSIGjakysBqzM+4De JSe0BC3vxwjiihNNvcDHxY0v50Y5m4xzrmeYzUMW4YGNP35oJDzqDGeydPvhe/5two0b PK0A== X-Received: by 10.236.137.101 with SMTP id x65mr3102592yhi.97.1358978334268; Wed, 23 Jan 2013 13:58:54 -0800 (PST) Received: from [192.168.1.102] ([190.192.49.157]) by mx.google.com with ESMTPS id k5sm21377946yhj.6.2013.01.23.13.58.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 13:58:53 -0800 (PST) Message-ID: <51005D6F.5010804@anue.biz> Date: Wed, 23 Jan 2013 19:00:15 -0300 From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnmibiiN0W9kJhNiC2VGlfo2c0SrpPe4DLPEL1LDmXwhFE4DW5u57EqYLfR9BNNlhBtkp9X X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close #13438 [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.51 listed in list.dnswl.org] 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4991] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close #13438 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.51 listed in list.dnswl.org] -0.0 BAYES_40 BODY: Bayes spam probability is 20 to 40% [score: 0.2820] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 TVD_SPACE_RATIO TVD_SPACE_RATIO close #13438 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 24 13:01:25 2013 Received: (at 13438) by debbugs.gnu.org; 24 Jan 2013 18:01:25 +0000 Received: from localhost ([127.0.0.1]:48113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyR77-0001TP-Dq for submit@debbugs.gnu.org; Thu, 24 Jan 2013 13:01:25 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:55142) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyR75-0001TJ-Gu for 13438@debbugs.gnu.org; Thu, 24 Jan 2013 13:01:24 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TyR6z-0000bY-PJ; Thu, 24 Jan 2013 13:01:17 -0500 From: Glenn Morris To: =?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina Subject: Re: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless References: X-Spook: diwn bce bank Centro Mena Ruby Ridge Attorney General Agfa X-Ran: {s2Aiqp\YuP~v (=?utf-8?Q?=22Fabi?= =?utf-8?Q?=C3=A1n?= Ezequiel Gallina"'s message of "Wed, 23 Jan 2013 18:55:46 -0300") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13438 Cc: 13438@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) > * imenu.el (imenu-default-create-index-function): Remove useless > infinite loop check. [...] > --- a/lisp/imenu.el 2013-01-01 09:11:05 +0000 > +++ b/lisp/imenu.el 2013-01-23 21:55:46 +0000 > @@ -683,8 +683,6 @@ > (goto-char (point-max)) > ;; Search for the function > (while (funcall imenu-prev-index-position-function) > - (when (= pos (point)) > - (error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos)) > (setq pos (point)) > (save-excursion > (setq name (funcall imenu-extract-index-name-function))) I'm not keen on removing an infinite loop check from emacs-24 at this stage. Why is this issue (apparently) only seen in Python mode, and why isn't there a Python-specific solution (which seems like it would be just making imenu-prev-index-position-function return nil when appropriate)? Related discussion: http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00536.html From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 24 13:30:26 2013 Received: (at 13438) by debbugs.gnu.org; 24 Jan 2013 18:30:26 +0000 Received: from localhost ([127.0.0.1]:48138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyRZC-0002BW-3s for submit@debbugs.gnu.org; Thu, 24 Jan 2013 13:30:26 -0500 Received: from mr001msr.fastwebnet.it ([85.18.95.64]:35514) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyRZA-0002BP-7U for 13438@debbugs.gnu.org; Thu, 24 Jan 2013 13:30:24 -0500 Received: from fmsmemgm.homelinux.net (93.63.184.150) by mr001msr.fastwebnet.it (8.5.140.03) id 50FFE8AF001E9126; Thu, 24 Jan 2013 19:30:17 +0100 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id AC564AE194; Thu, 24 Jan 2013 13:30:16 -0500 (EST) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#13438: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless Message-ID: References: Date: Thu, 24 Jan 2013 13:30:16 -0500 In-Reply-To: (Glenn Morris's message of "Thu, 24 Jan 2013 13:01:17 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > I'm not keen on removing an infinite loop check from emacs-24 at this > stage. The patch is "safe" in the sense that it will only introduce an inf-loop in those cases where the user used to get an error. [ Unless of course, the calling context catches those errors. ] [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [85.18.95.64 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4821] X-Debbugs-Envelope-To: 13438 Cc: =?iso-8859-1?Q?Fabi=E1n?= Ezequiel Gallina , 13438@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) > I'm not keen on removing an infinite loop check from emacs-24 at this > stage. The patch is "safe" in the sense that it will only introduce an inf-loop in those cases where the user used to get an error. [ Unless of course, the calling context catches those errors. ] > Why is this issue (apparently) only seen in Python mode, and why > isn't there a Python-specific solution (which seems like it would be > just making imenu-prev-index-position-function return nil when > appropriate)? If we can change python.el to work around the problem, we could install that workaround in emacs-24 and keep the "remove the inf-loop check" for the trunk, indeed. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 25 03:35:06 2013 Received: (at 13438) by debbugs.gnu.org; 25 Jan 2013 08:35:06 +0000 Received: from localhost ([127.0.0.1]:48585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyeka-0000H7-Q2 for submit@debbugs.gnu.org; Fri, 25 Jan 2013 03:35:05 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:44835) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyekX-0000Gi-Gs for 13438@debbugs.gnu.org; Fri, 25 Jan 2013 03:35:02 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TyekP-0004gW-7k; Fri, 25 Jan 2013 03:34:53 -0500 From: Glenn Morris To: Stefan Monnier Subject: Re: bug#13438: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless References: X-Spook: Ermes tempest Hamas Bin Laden chameleon man genetic CNCIS X-Ran: xfSinP(Y}!_R{k#n$~4kv$W\*Q%`F2eFV?/mH&OW?A,DOzV|fwH|Wpd_QG$0AfM&!+c:+C X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 25 Jan 2013 03:34:53 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 24 Jan 2013 13:30:16 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13438 Cc: =?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina , 13438@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) >> Why is this issue (apparently) only seen in Python mode Answering my own question, it happens in any mode that sets imenu-prev-index-position-function and imenu-extract-index-name-function, but there are very few of those. Eg prolog mode. With buffer contents: ------ fac(0,1). fac(N,F) :- N > 0, M is N - 1, fac(M,Fm), F is N * Fm. ------ and point at point-min, switching to prolog-mode causes the same issue. How about taking the more cautious approach with: (when (and (= pos (point)) (not (bobp))) (error "Infinite loop... )) (IIUC, this was actually the suggestion in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00510.html ?) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 25 08:54:51 2013 Received: (at 13438) by debbugs.gnu.org; 25 Jan 2013 13:54:51 +0000 Received: from localhost ([127.0.0.1]:48857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyjk2-0000HN-Bk for submit@debbugs.gnu.org; Fri, 25 Jan 2013 08:54:50 -0500 Received: from mail-gh0-f173.google.com ([209.85.160.173]:52076) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyjjz-0000H6-VA for 13438@debbugs.gnu.org; Fri, 25 Jan 2013 08:54:49 -0500 Received: by mail-gh0-f173.google.com with SMTP id g2so44347ghb.4 for <13438@debbugs.gnu.org>; Fri, 25 Jan 2013 05:54:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type:x-gm-message-state; bh=3U7Kyt0xprcIghgPXEtFeAnWpRyPuhvlzrWPVtaI89Y=; b=Hx8u8hSbmLpL3t2Aln4xslro3DWi9+rFVEgP3etMDux3nooM0XzjUhQuIElD1+SZ3m Q++RXW5niYJinoaocgfLwxTlyZh0sCvffnlR02mhPY8CuVUvoEtbYdVAo4GzQliyfSh4 cNlfUl6jvvV4gk5ZiAYBRPoM2/f7RkFtZ6JqoajkpfoSsI8R8i/wDC08PJ9+L4pC99lP 71lASE4uI64EusJ/fn4WGgMHu65g6GC2SE33MNMsNXagGOQqpB3iaA3d1gjUKX5zbVgn BCtCol+xbfSVyXDNe1L0NRoqhXUIztvzjZHRjn12X+7yGDLR5SzMYJAs3w4+jDzcOuT0 jHOA== X-Received: by 10.236.121.99 with SMTP id q63mr5956174yhh.105.1359122073752; Fri, 25 Jan 2013 05:54:33 -0800 (PST) Received: from [192.168.1.136] (OL144-145.fibertel.com.ar. [24.232.145.144]) by mx.google.com with ESMTPS id r17sm776322ani.8.2013.01.25.05.54.30 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jan 2013 05:54:32 -0800 (PST) Message-ID: <51028EED.30406@anue.biz> Date: Fri, 25 Jan 2013 10:55:57 -0300 From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: Glenn Morris Subject: Re: bug#13438: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030900070104000800040207" X-Gm-Message-State: ALoCoQn9rZEVNBaaw27dp9X1ZlrC+2qZVGkrXPlAPneVJcPsefwKpV8M4rcvtB0xUdhqVEwTRTfA X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13438 Cc: 13438@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------030900070104000800040207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/25/2013 05:34 AM, Glenn Morris wrote: >>> Why is this issue (apparently) only seen in Python mode > Answering my own question, it happens in any mode that sets > imenu-prev-index-position-function and > imenu-extract-index-name-function, but there are very few of those. > > Eg prolog mode. With buffer contents: > > ------ > fac(0,1). > fac(N,F) :- N > 0, M is N - 1, > fac(M,Fm), F is N * Fm. > ------ > > and point at point-min, switching to prolog-mode causes the same issue. > > How about taking the more cautious approach with: > > (when (and (= pos (point)) > (not (bobp))) > (error "Infinite loop... )) > > (IIUC, this was actually the suggestion in > http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00510.html ?) I ran into the same thing, and checking bobp is not enough, try adding a newline at the beginning of file to the recipe and call imenu with point at beginning of defun and you'll see the infinite error check will trigger. I proposed the following patch that works: === modified file 'lisp/imenu.el' --- lisp/imenu.el 2013-01-01 09:11:05 +0000 +++ lisp/imenu.el 2013-01-22 18:24:45 +0000 @@ -683,7 +683,14 @@ (goto-char (point-max)) ;; Search for the function (while (funcall imenu-prev-index-position-function) - (when (= pos (point)) + (when (and (= pos (point)) + (= pos + (save-excursion + ;; The infinite loop is true if there's + ;; another index position but point keeps + ;; itself in the same place. bug#13438 + (if (funcall imenu-prev-index-position- function) + (point) 0)))) But finally after some mails with Stefan we decided the best thing will be to remove this check altogether. --------------030900070104000800040207 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 01/25/2013 05:34 AM, Glenn Morris wrote:

      
Why is this issue (apparently) only seen in Python mode
Answering my own question, it happens in any mode that sets
imenu-prev-index-position-function and
imenu-extract-index-name-function, but there are very few of those.

Eg prolog mode. With buffer contents:

------
fac(0,1).
fac(N,F) :- N > 0, M is N - 1,
       fac(M,Fm), F is N * Fm.
------

and point at point-min, switching to prolog-mode causes the same issue.

How about taking the more cautious approach with:

(when (and (= pos (point))
           (not (bobp)))
   (error "Infinite loop... ))

(IIUC, this was actually the suggestion in
http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00510.html ?)
I ran into the same thing, and checking bobp is not enough, try adding a newline at the beginning of file to the recipe and call imenu with point at beginning of defun and you'll see the infinite error check will trigger.

I proposed the following patch that works:

=== modified file 'lisp/imenu.el'
--- lisp/imenu.el       2013-01-01 09:11:05 +0000
+++ lisp/imenu.el       2013-01-22 18:24:45 +0000
@@ -683,7 +683,14 @@
           (goto-char (point-max))
           ;; Search for the function
           (while (funcall imenu-prev-index-position-function)
-             (when (= pos (point))
+             (when (and (= pos (point))
+                        (= pos
+                           (save-excursion
+                             ;; The infinite loop is true if there's
+                             ;; another index position but point keeps
+                             ;; itself in the same place. bug#13438
+                             (if (funcall imenu-prev-index-position-
function)
+                                 (point) 0))))

But finally after some mails with Stefan we decided the best thing will be to remove this check altogether.

--------------030900070104000800040207-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 26 21:13:16 2013 Received: (at 13438) by debbugs.gnu.org; 27 Jan 2013 02:13:16 +0000 Received: from localhost ([127.0.0.1]:50896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzHkB-0002TX-Gu for submit@debbugs.gnu.org; Sat, 26 Jan 2013 21:13:16 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:54360) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzHk7-0002TM-1h for 13438@debbugs.gnu.org; Sat, 26 Jan 2013 21:13:12 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TzHjn-0000MY-3i; Sat, 26 Jan 2013 21:12:51 -0500 From: Glenn Morris To: =?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina Subject: Re: bug#13438: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless References: <51028EED.30406@anue.biz> X-Spook: gamma SSL chameleon man csystems Belknap arrangements X-Ran: .-uo`i+RVnw5gp8^>l^Zgaf0P{K?Tha343]238(8G!F'Pf82x=4{BA\"muB.k&nO\?<8O) X-Hue: magenta X-Attribution: GM Date: Sat, 26 Jan 2013 21:12:50 -0500 In-Reply-To: <51028EED.30406@anue.biz> (=?utf-8?Q?=22Fabi=C3=A1n?= Ezequiel Gallina"'s message of "Fri, 25 Jan 2013 10:55:57 -0300") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13438 Cc: 13438@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Oh, so the actual issue is: if you call imenu-default-create-index-function with point at the start of the last defun in the buffer. It goes to point-max, then back to the start of the defun, and mistakenly thinks it is inflooping. How about the following, which only signals an error if imenu-prev-index-position-function returns non-nil twice in a row without moving point. BTW, neither python-nav-beginning-of-defun or python-imenu-prev-index-position will move past the start of the first defun in a buffer, if the defun begins past point-min (ie, if there are blank lines before the first defun, it does not move over them to point-min). I don't know if this matters, but it is inconsistent with eg Prolog and Emacs Lisp modes. *** lisp/imenu.el 2013-01-23 21:55:46 +0000 --- lisp/imenu.el 2013-01-27 02:02:39 +0000 *************** *** 678,688 **** ;; in these major modes. But save that change for later. (cond ((and imenu-prev-index-position-function imenu-extract-index-name-function) ! (let ((index-alist '()) (pos (point)) name) (goto-char (point-max)) ;; Search for the function (while (funcall imenu-prev-index-position-function) (setq pos (point)) (save-excursion (setq name (funcall imenu-extract-index-name-function))) --- 678,690 ---- ;; in these major modes. But save that change for later. (cond ((and imenu-prev-index-position-function imenu-extract-index-name-function) ! (let ((index-alist '()) (pos -1) name) (goto-char (point-max)) ;; Search for the function (while (funcall imenu-prev-index-position-function) + (when (= pos (point)) + (error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos)) (setq pos (point)) (save-excursion (setq name (funcall imenu-extract-index-name-function))) From unknown Fri Jun 20 07:22:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 24 Feb 2013 12:24:03 +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