From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.devel Subject: Re: Python interactive navigation around nested functions Date: Mon, 20 Jun 2016 23:05:44 -0700 Message-ID: <87d1nbdqkn.fsf@secretsauce.net> References: <87lh21eq5c.fsf@secretsauce.net> <87eg7rdrj7.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466489231 1254 80.91.229.3 (21 Jun 2016 06:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 06:07:11 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 21 08:06:57 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 1bFEpr-00049o-KG for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2016 08:06:55 +0200 Original-Received: from localhost ([::1]:48899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFEpq-0001CY-PX for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2016 02:06:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFEp0-0001Au-Pw for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:06:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFEou-0006xl-MC for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:06:01 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFEos-0006uY-AW for emacs-devel@gnu.org; Tue, 21 Jun 2016 02:05:56 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4E762207CC; Tue, 21 Jun 2016 02:05:47 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 21 Jun 2016 02:05:47 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=qRJm/ PNl8cCaMGfQdCbjeGFEj9Q=; b=SkZGbi/fIlmSfgcLhmhfgZS+M6Sb3EDhvpPuX 3vueHwRibX/bS2ssu3rtd0lk3Vqf7rhpNooF8xvvnczbY9PVKfguiexAiLdt2owT uoxDyq847EIibaAh6/+OAhDgAd8XDIy9SF5wdqRmCQH4nZkDFFpR+poCuNi8vjxG slg3lg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=qRJm/PNl8cCaMGfQdCbjeGFEj9Q=; b=iDZui T3HulxAb91DionzyHTulKFAMACwW7VCeVqeErad6rmRbtKHpdB2827lWhPtQxtUl e/XhfPuyaD2hSU148V+s7XGoTHMIzHyBtKonzTogSNQSj3RKmjM/zrjJC0MDmK+T hefSLR08xnEdyQINwOvI8GuysfuDhRhy3BWNHY= X-Sasl-enc: YivT/yxkpyRsHQtXfjnpfnKMbplYQ4MVMlAPehH7lNfc 1466489146 Original-Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id D2240F29FA; Tue, 21 Jun 2016 02:05:46 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1bFEoj-0005EZ-2L; Mon, 20 Jun 2016 23:05:45 -0700 User-agent: mu4e 0.9.17; emacs 25.0.94.1 In-reply-to: <87eg7rdrj7.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 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:204631 Archived-At: Dima Kogan writes: > I don't really LIKE it, though, so let me ponder. OK. I pondered for 10 minutes. I think the current behavior is strange, and I think the following would be much more natural: 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 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. This would do what I would want, and I think is far more reasonable. The current behavior has some side-effects, which can probably be called "bugs" without controversy. Say you have this: def bbb(): print 11 print 22 def ccc(): print 33 print 44 print 55 print 55 print 55 print 55 def ddd(): print 123 >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. dima