From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Python interactive navigation around nested functions Date: Tue, 21 Jun 2016 02:21:01 -0400 Message-ID: References: <87lh21eq5c.fsf@secretsauce.net> <87eg7rdrj7.fsf@secretsauce.net> <87d1nbdqkn.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466490030 12701 80.91.229.3 (21 Jun 2016 06:20:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 06:20:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 21 08:20:21 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFF2p-0002pX-Oo for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2016 08:20:19 +0200 Original-Received: from localhost ([::1]:49089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFF2p-0007Za-3g for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2016 02:20:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFF2C-0007ZI-Aw for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:19:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFF27-0002B4-8F for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:19:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:32844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFF27-0002B0-2A for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:19:35 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bFF20-0001ut-Ty for emacs-devel@gnu.org; Tue, 21 Jun 2016 08:19:29 +0200 Original-Received: from 76-10-168-254.dsl.teksavvy.com ([76.10.168.254]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jun 2016 08:19:28 +0200 Original-Received: from monnier by 76-10-168-254.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jun 2016 08:19:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 76-10-168-254.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:X7g9GGJcFdjG7FSpf7GuJzLUaKw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204632 Archived-At: > 1. If we're on a function-definition line, C-M-a should go up to the > previous definition, at the SAME OR HIGHER AST level OK, that's what it's supposed to be already. > 2. If we're NOT on a function-definition line, C-M-a should go up to the > previous definition, at a HIGHER AST level. That's a significant change. It means that if we're between two functions (e.g. on a static var declaration in a C file), C-M-a would jump to BOB. > From any of the "print 55" lines, C-M-h selects the whole "def ddd" > block, which I would not expect at all. If the ddd block isn't there, > then it selects all of the "ccc" block, which is wrong too: neither of > these contain the statement we started on. One could call this a > separate bug from the original complaint, but changing the C-M-a > definition makes this work naturally. These behaviors are indeed problematic (AFAICT they're plain bugs w.r.t the behavior described in the docstring), but they affect C-M-h, so hopefully we can fix them in C-M-h without having to change C-M-a. Of course by C-M-a we can mean different things: - the backend navigation code provided by the major mode via *-of-defun-function. - the command bound to C-M-a. - the beginning-of-defun command. They don't do exactly the same thing either, and the constraints w.r.t changing them are slightly different (e.g. some allow the introduction of a whole new backend API, or the rebinding of C-M-a to another command). Stefan