From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#52092: 28.0.60; hs-toggle-hiding does not toggle once folded Date: Sat, 24 Sep 2022 11:10:26 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26028"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Dan Nicolaescu , Thien-Thi Nguyen , Eli Zaretskii , 52092-done@debbugs.gnu.org, Mohammed Sadiq To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 24 17:11:23 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 1oc6oM-0006al-Sb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 17:11:23 +0200 Original-Received: from localhost ([::1]:54340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oc6oL-0002Uv-Te for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 11:11:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc6o2-0002Sk-Mu for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc6o2-000057-Dz for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oc6o2-0005Uw-9t for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 11:11:02 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Sep 2022 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 52092 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: help Mail-Followup-To: 52092@debbugs.gnu.org, monnier@iro.umontreal.ca, sadiq@sadiqpk.org Original-Received: via spool by 52092-done@debbugs.gnu.org id=D52092.166403223821102 (code D ref 52092); Sat, 24 Sep 2022 15:11:02 +0000 Original-Received: (at 52092-done) by debbugs.gnu.org; 24 Sep 2022 15:10:38 +0000 Original-Received: from localhost ([127.0.0.1]:44968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc6ne-0005UI-EB for submit@debbugs.gnu.org; Sat, 24 Sep 2022 11:10:38 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc6na-0005Ty-IL for 52092-done@debbugs.gnu.org; Sat, 24 Sep 2022 11:10:37 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 289F710013B; Sat, 24 Sep 2022 11:10:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 611431000F3; Sat, 24 Sep 2022 11:10:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664032227; bh=rGVVNzctMfEwiUgQZWySYLfT9V8sxiTH1vAyK3wuPnM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=c9TapdTKSrYCilQE8aiR70VYLFm3Dw/HQPafYdPC5Mq6NAIzb+WwBvhL6PE0OCJv4 9kE66U0aAneACqnGRmuNFAKf+55GPsTiecu9QXJd3Sajcg389y74DjpEJBUq1x2swS SsRLmZgBOg0zGgPQvxK7PljPZ+UanJg+p47iHJEx7Ox1MIotU/Z7C5x4K7a0EGhYDB bPMejLZ+wk/MYMie+HuTcssKZa/fqbP3XiEpaexY9lLidf8DxukDOcbUKVwpIzZQ2V KSmzuwAXVLCz1fSq/AdH8WJfTs2pG7gWYT9Kq9hWxL/x9S3+s3PKCy/yL4r1yYOIiL ixRZnSQF4qnjw== Original-Received: from pastel (unknown [45.72.225.122]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0A2C31205D7; Sat, 24 Sep 2022 11:10:27 -0400 (EDT) In-Reply-To: (kobarity@gmail.com's message of "Sat, 24 Sep 2022 14:59:56 +0900") 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:243544 Archived-At: [ Added Thien-Thi and Dan to the Cc since they're listed as maintainers of `hideshow.el`. ] kobarity [2022-09-24 14:59:56] wrote: > Stefan Monnier wrote: >> The patch below should fix it. > Thanks, I didn't know `last-nonmenu-event'. I confirmed that the > patch enables the mouse to hide the clicked block. I pushed it to the `emacs-28` branch, because it's fixing a stupid regression. >> I had no idea that (posn-point (posn-at-point POS)) doesn't return POS >> if POS is within an invisible chunk of text and instead returns the next >> visible position. >> >> I'll have to think about how best to fix the consequence. > > Thank you for consideration. I pushed to `master` a patch which makes `event-end` return a position that's always at `point` for keyboard events, even if `point` is hidden. That should bring back the previous behavior (it's not safe enough for the `emacs-28` branch, sadly). But I think your patch is still an improvement since it makes `hs-toggle-hiding` work even when point is right after the hidden block. I also like the additional tests you provide. So I adjusted it to the new code and pushed it to `master`. Thank you, Stefan