From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#56635: 29.0.50; [PATCH] hide-show in python-mode supports ONLY function and class blocks Date: Sat, 23 Jul 2022 13:41:27 -0700 Message-ID: <87sfmr5zi9.fsf@secretsauce.net> References: <87v8ruysep.fsf@secretsauce.net> <87zgh01cqm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9422"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 29.0.50 Cc: Lars Ingebrigtsen , 56635@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 23 22:47:14 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 1oFM1o-00029f-6b for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 22:47:14 +0200 Original-Received: from localhost ([::1]:51632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFM1m-0008P0-PI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 16:47:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFM1f-0008Oi-1q for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 16:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFM1e-00061j-P6 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 16:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFM1e-0002he-Hd for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 16:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2022 20:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56635 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56635-submit@debbugs.gnu.org id=B56635.165860916510297 (code B ref 56635); Sat, 23 Jul 2022 20:47:02 +0000 Original-Received: (at 56635) by debbugs.gnu.org; 23 Jul 2022 20:46:05 +0000 Original-Received: from localhost ([127.0.0.1]:46396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFM0i-0002g1-RG for submit@debbugs.gnu.org; Sat, 23 Jul 2022 16:46:05 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:44985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFM0f-0002fM-So for 56635@debbugs.gnu.org; Sat, 23 Jul 2022 16:46:03 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id AE7C63200583; Sat, 23 Jul 2022 16:45:55 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 23 Jul 2022 16:45:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1658609155; x=1658695555; bh=Qj xqZasE3hoA7qOkdHJWpI1ryB+E4h7cx2GG235qd9g=; b=1SQLPiDaG0etYezrqO ieqe33xpX72jk8bNlLeWlgOOYxTaju0IjA9D48qojxCCX8ZOFYEPviZO4S7adZXk SAbc236ckWRi/9zWKxRVLkJbFXY9dRyYuwY9vqcxOIhs2fqIQZU2iBpAjztzmdjS viGXreBvgTXnvzYBpw6InC3WcZ5yjX6Vdb4Y60/yHpSLdv2x8kAsKFIcyxwRmM9G am/PFNNG/31Me7MHg6rE2ldG2TWxBOxV1ytXLNohyb8jaiv65s+Ga4SXnE1g7TiS nR9ilhfo/0sIDoOKVZuAcSLpdZrFCn4FMI9JdstKx6odTgnt0C9HwrlAGW+PuaEQ xStw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1658609155; x=1658695555; bh=QjxqZasE3hoA7qOkdHJWpI1ryB+E 4h7cx2GG235qd9g=; b=oqcs/LKJTDiUHWw1vNUwVSAnbRzG7YXMM6O8/Nu4z86o eeHQ/mG0HH8H0/TonCAkKOd+5u2HFVmTij2WlKvYHQdrKogi0aqNrloJXpYyT96o GiR9grzTM2Fh5sGGqmapZx4hHHvKWEDFL0TW10MFUyja8v75a5qMUs0ufdR6hkBm dIUGI9SqFDtah+nYwF85W9niHAigiFqxetw/4gqmMIzg8Kfw0HOC8V4fJJ0EVY0Q nXUycFKQ5bQfhXAKVwD5NtpEFlbfXWQCa6Yd6ZSLS61yAlBfTh9qdmfmoR6jNeTS lZAUbXuSjqMKq8mJNmbGL+Gm21zbBY8dzXKmI/W7aA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddtgedgudehjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeffihhm rgcumfhoghgrnhcuoeguihhmrgesshgvtghrvghtshgruhgtvgdrnhgvtheqnecuggftrf grthhtvghrnhepgfeifeehgedvkeekvdevvdelvdegleevtedvueejvdejveduveeuleev leevudetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epughimhgrsehsvggtrhgvthhsrghutggvrdhnvght X-ME-Proxy: Feedback-ID: i3e8042a0:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Jul 2022 16:45:54 -0400 (EDT) In-reply-to: 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:237790 Archived-At: Thanks for taking the time to look at this. After a big more dogfooding, I've a small tweak to the first piece of the patch: diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1c99937c4b9..2b2b0900bee 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4819,9 +4819,7 @@ python-describe-at-point (defun python-hideshow-forward-sexp-function (_arg) "Python specific `forward-sexp' function for `hs-minor-mode'. Argument ARG is ignored." - (python-nav-end-of-defun) - (unless (python-info-current-line-empty-p) - (backward-char))) + (python-nav-end-of-block)) ;;; Imenu So (python-hideshow-forward-sexp-function) should call (python-nav-end-of-block) and do nothing else. I think the extra (backward-char) stuff was intended to handle the closing brace of the block, which doesn't exist in Python. If you leave the (backward-char) stuff there, the collapsed blocks still display the last character in the block, which in Python has no special syntactical meaning.