GNU bug report logs - #52092
28.0.60; hs-toggle-hiding does not toggle once folded

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Mohammed Sadiq <sadiq@HIDDEN>; Keywords: help; dated Thu, 25 Nov 2021 07:42:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) help. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 52092 <at> debbugs.gnu.org:


Received: (at 52092) by debbugs.gnu.org; 25 Nov 2021 10:30:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 25 05:30:00 2021
Received: from localhost ([127.0.0.1]:55874 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mqC0u-0000aq-6g
	for submit <at> debbugs.gnu.org; Thu, 25 Nov 2021 05:30:00 -0500
Received: from eggs.gnu.org ([209.51.188.92]:41544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mqC0t-0000aR-Ea
 for 52092 <at> debbugs.gnu.org; Thu, 25 Nov 2021 05:29:59 -0500
Received: from [2001:470:142:3::e] (port=35788 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mqC0n-0005QN-Gt; Thu, 25 Nov 2021 05:29:53 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=628ALGa6NXUJ78uyriIrr79EOHkoMSQ16nbnX5ipt5s=; b=QRmhIjZ+pjkh
 oorC6hEoQg8Y8muZeCF6gUWFXmErJ0s0qQBVm6SCPgVDGpmpRq4B1b8l7fMh1Tg34E/IXVPC/V8sf
 2tKXywedkmbIOg3BM7mf+G/B2H71dlg0kZrS9iPTWMUd+BFhPfoQL4rtKiK+bGW+tuKlzT4k7yeXR
 nY4wD3Px36Qb1T/cAvWn38X5+JQg6QvP9g5ADjZLUju/hehmiocx8jCswOXWb4DolGj8g8+kPvVjQ
 PLLhayEygWpOrpvM7p8I4PEjP+wLEfg8+0A35KCEqMYXxSEYoRGdRXJtsANmlwZWldyduAGMi43J7
 8wN0sr5vv06PB6qPO2LcXA==;
Received: from [87.69.77.57] (port=3955 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mqC0n-0004u6-3I; Thu, 25 Nov 2021 05:29:53 -0500
Date: Thu, 25 Nov 2021 12:29:54 +0200
Message-Id: <834k807ckd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mohammed Sadiq <sadiq@HIDDEN>
In-Reply-To: <178345d38657e8ad3b7cb50b644b1c5c@HIDDEN> (message from
 Mohammed Sadiq on Thu, 25 Nov 2021 13:10:51 +0530)
Subject: Re: bug#52092: 28.0.60; hs-toggle-hiding does not toggle once folded
References: <178345d38657e8ad3b7cb50b644b1c5c@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52092
Cc: 52092 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 25 Nov 2021 13:10:51 +0530
> From: Mohammed Sadiq <sadiq@HIDDEN>
> 
> 
> With hs-minor-mode enabled, I could hide the visibility of a block with
> hs-toggle-hiding, but using it again doesn't unfold the region.
> 
> Tested with c-mode and css-mode.

It seems that unhiding works only if you are at the beginning of the
hidden block.  In C Mode, that means cursor is on the opening brace of
the block.

The problem seems to be inside hs-already-hidden-p:

  (defun hs-already-hidden-p ()
    "Return non-nil if point is in an already-hidden block, otherwise nil."
    (save-excursion
      (let ((c-reg (hs-inside-comment-p)))
	(if (and c-reg (nth 0 c-reg))
	    ;; point is inside a comment, and that comment is hideable
	    (goto-char (nth 0 c-reg))
	  (end-of-line)

That call to end-of-line moves point outside of the braces _unless_
point is on the left brace that starts the hidden block.  That
movement then makes it appear as if we are in the outer block, not in
the one that you've just hidden.

I don't know enough about hideshow.el and don't use it enough to
propose a robust enough solution for this which won't break some use
case out there.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52092; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2021 07:41:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 25 02:41:07 2021
Received: from localhost ([127.0.0.1]:55642 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mq9NQ-0002dt-2A
	for submit <at> debbugs.gnu.org; Thu, 25 Nov 2021 02:41:07 -0500
Received: from lists.gnu.org ([209.51.188.17]:48144)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sadiq@HIDDEN>) id 1mq9NM-0002dJ-30
 for submit <at> debbugs.gnu.org; Thu, 25 Nov 2021 02:41:03 -0500
Received: from eggs.gnu.org ([209.51.188.92]:58876)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sadiq@HIDDEN>) id 1mq9NL-0001gi-Mo
 for bug-gnu-emacs@HIDDEN; Thu, 25 Nov 2021 02:40:59 -0500
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41729)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sadiq@HIDDEN>) id 1mq9NJ-0000sy-F6
 for bug-gnu-emacs@HIDDEN; Thu, 25 Nov 2021 02:40:59 -0500
Received: (Authenticated sender: sadiq@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPA id 90EF92000A
 for <bug-gnu-emacs@HIDDEN>; Thu, 25 Nov 2021 07:40:51 +0000 (UTC)
MIME-Version: 1.0
Date: Thu, 25 Nov 2021 13:10:51 +0530
From: Mohammed Sadiq <sadiq@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.60; hs-toggle-hiding does not toggle once folded
Message-ID: <178345d38657e8ad3b7cb50b644b1c5c@HIDDEN>
X-Sender: sadiq@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=217.70.183.200; envelope-from=sadiq@HIDDEN;
 helo=relay7-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)


With hs-minor-mode enabled, I could hide the visibility of a block with
hs-toggle-hiding, but using it again doesn't unfold the region.

Tested with c-mode and css-mode.

In GNU Emacs 28.0.60 (build 2, x86_64-pc-linux-gnu, GTK+ Version 
3.24.30, cairo version 1.16.0)
  of 2021-11-25 built on purism
Repository revision: 0854453ec2343cbfac3ac8e233cdc7bd2c8554a9
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 
11.0.12011000
System Description: Debian GNU/Linux bookworm/sid

Configured using:
  'configure --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
   value of $LANG: en_IN
   value of $XMODIFIERS: @im=ibus
   locale-coding-system: iso-latin-1-unix

Major mode: C/*l

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t
   abbrev-mode: t
   hs-minor-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail comp comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra
help-mode rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
hideshow vc-git diff-mode easy-mmode vc-dispatcher seq byte-opt gv
bytecomp byte-compile cconv cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 125023 9196)
  (symbols 48 10111 1)
  (strings 32 30461 3484)
  (string-bytes 1 1135663)
  (vectors 16 20448)
  (vector-slots 8 388478 20146)
  (floats 8 31 60)
  (intervals 56 377 0)
  (buffers 992 13))




Acknowledgement sent to Mohammed Sadiq <sadiq@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#52092; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 3 Dec 2021 01:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.