From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#54119: 29.0.50; Edebug: Jumping commands in recursive definitions Date: Wed, 23 Feb 2022 05:09:39 +0100 Message-ID: <87czjez0jg.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35994"; mail-complaints-to="usenet@ciao.gmane.io" To: 54119@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 23 05:10:43 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 1nMizC-0009A8-M6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Feb 2022 05:10:42 +0100 Original-Received: from localhost ([::1]:36790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMizB-00079M-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Feb 2022 23:10:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMiya-000799-Mo for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 23:10:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMiyY-0005bA-Kd for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 23:10:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMiyY-00033u-5K for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 23:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Feb 2022 04:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54119 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164558938711742 (code B ref -1); Wed, 23 Feb 2022 04:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Feb 2022 04:09:47 +0000 Original-Received: from localhost ([127.0.0.1]:43374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMiyJ-00033K-2X for submit@debbugs.gnu.org; Tue, 22 Feb 2022 23:09:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMiyH-00033C-KK for submit@debbugs.gnu.org; Tue, 22 Feb 2022 23:09:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMiyH-00077K-EB for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 23:09:45 -0500 Original-Received: from mout.web.de ([212.227.17.11]:50681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMiyE-0005Y9-6M for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 23:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645589380; bh=diTtU1tBsC73Obydl0MigqiAMWELzoZRDcranjH5Xkk=; h=X-UI-Sender-Class:From:To:Subject:Date; b=Na+G4HXKLxFkiPSdmI+CxbyfXg4mNJS8vHnBJwUmvfa3DttY2nExDUC28tghYdSmv UoiRXk9LH5RR6doFjRsxsYfQDnEc/KKGRI3YJ0+pUq3FJkIQUY6EwFwmemNHTECZ5H kMIv5Jgs5OmjO3mwLDmh5m6EDBGwX5PNPDr1wrlM= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MIya8-1nh9Gj3WBu-00KUKA for ; Wed, 23 Feb 2022 05:09:39 +0100 X-Provags-ID: V03:K1:sEEij0xRfNHkeC8BOVQbIuq5TBxt0uKm2aqfDglKhenlHnB3W6I G2gq8RaNupgVFhfsux6QD1poKRQSv89Cd4osw6vg5qRfNKnpfnnIEXxWByGEuGldOFMY/qt BqJz0IMxspJs7x0HbIsvsW+0EHpqYv2z1251+T1v1NXTOi52xy0PynqTNqCNGPAf8apGaFW TIpXuwEP/eekvJGXAkbiQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:RgpBtXIcEdE=:A6wW5jCXrE4bLz2N6DXFx1 PTOCml3v8uldKpTn0WEMGOmqmqeAuhX2pw+LHi3tpmfv8BxZ0WCuaAXQymC4iAl/45A2KQQe8 0q9bXMUCc5EZ9q2Xf5HzcZQK4/Lsk4D2A+Pf9hDAkWw1/uBVvkMsVx8VLANLR6Lqq6+vvscV6 zoKGtYVUyz0Jkc1oaxy03v02kQqyy9mAQFCEMRhNuXoUu4mo55xHKtn2Tmlkacdroaj2Xx511 X/S3WKVYjEXctLDJocS62OK+nK5vGkkqWlrqpl6X2jNPrcWgNapdVh5uGP6EeFQ5eryauDSJc gcFarpxuBMAt0VizKfgpL5LoCeAZurwUUL0t1jKqDZzKATeHmEHaxhnGLLIXK3SFF20ezcrUH duroknKBOQ+80Q8EzbZLJ/l7RXp8BvMVq+I7pMKA54o5nMEymvX7SWxk905f9/WCNOCuAvOFD Quj25NZUVVXBixZvxxryYz1fnEtygpgDme10Gf3iEf4yuIOqjNUmCW5TbiIz5g3fpOuhVS96r h4/OpmJ9ZfA6DaUAO3kX33Nrw83CjWVDz0w+6c7HFNuL7YlJuAd69/UQg4jfcD63orSYHB5tw ZSVfGPFkTOdKchzmaYoX6SGZFOXyC8aGscK7Mm18I9KriJgJtBTqQ33iuF1hyxh4MmGVx/tb/ xKT76y6AxOtlFicwBcQ2yCDmLF1kyXOKjI/LP8sL4LDiViNN4oDeH+2AGurnRKXVrTgO3nAXJ mfFCp+n9Dke0yaCVLdeJZnttpuSBqaxFpfDlaQDixJwrsYD02wmc87XHDSxF65EPEC+fACmL Received-SPF: pass client-ip=212.227.17.11; envelope-from=michael_heerdegen@web.de; helo=mout.web.de 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:227477 Archived-At: Hello, the Edebug sexp jumping commands f and o can behave surprisingly (I would say annoyingly and wrong) when used near recursive calls of the current function. Let me demonstrate the problem with an example: Instrument #+begin_src emacs-lisp (defun my-factorial (n) (if (< n 2) 1 (* n (my-factorial (1- n))))) #+end_src ^ | M-: (my-factorial 5) RET and hit SPC until the cursor is before the front of the recursive call of `my-factorial' (as indicated). Hit f. You get "2" as result. This is quite unexpected, one would expect (my-factorial 4) ==> 24. What happened is that Edebug does not really "jump" over the following expression, it just sets a breakpoint after it and enters "go" mode. That breakpoint "breaks" the next time it is passed, and that is, in the above example, at the end of the innermost recursion, AFAIU. The same thing can happen with `o'. When that kind of thing happens, it can become a very tricky task to edebug what you wanted to. I don't know - can we make those "internal" breakpoints conditional and let the condition check the recursion level, somehow? Although, even then, some obscure kinds of code using catch and throw might still behave surprisingly. Edebug would somehow have to check that the jumped over execution frame terminates normally, or something like that. TIA, Michael. In GNU Emacs 29.0.50 (build 33, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2022-02-23 built on drachen Repository revision: be7c8c79eb874e3297c8492b1363fb0b8c433fae Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye)