GNU bug report logs - #79810
hideshow: Indicators missing for same-line multi-blocks

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: Juri Linkov <juri@HIDDEN>; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.0.50, send any further explanations to 79810 <at> debbugs.gnu.org and Juri Linkov <juri@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 79810) by debbugs.gnu.org; 11 Nov 2025 07:41:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 11 02:41:30 2025
Received: from localhost ([127.0.0.1]:42993 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vIj0L-000722-Km
	for submit <at> debbugs.gnu.org; Tue, 11 Nov 2025 02:41:30 -0500
Received: from mout-p-101.mailbox.org ([80.241.56.151]:49922)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1vIj0E-00071U-8Q; Tue, 11 Nov 2025 02:41:22 -0500
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4d5JPM6k6Sz9t74;
 Tue, 11 Nov 2025 08:41:11 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1762846871;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=2gzwYBlHSPnwY6Rs/0+n3ubF912/axf4RUOgUNYxgAg=;
 b=sQjDIx4fvj/tDap6ZfoRV3ybCSFISIzWGbbLpg7wQ27hMG5hMswzjSDH2rcoOHVFcnvNaL
 ClhiXC8DF/FmyNQMvyO/txKNKH7oAhjwiW1VTEgijXir79h1lhfFLmVgMzbOWw72QSsCs0
 +KRJb788E7/ehxPwnahcTf5wkk4hpkYeAoCKO+5S1e3A9j8DjZ8yopqdEz/3t9FxNrjXCd
 jXAw3UDdUBCZNVrdbjJgvwvMqQX/ET92Z8WEM7mEoV23YrgA+vS2/UCOh7yXLT71MjcCQU
 6W471BYJEalncJyeGAwIAnnwYnhe3D+0s1JLV9ni2a00hbniOiu2tyqY1bqmDg==
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#79810: hideshow: Indicators missing for same-line multi-blocks
In-Reply-To: <871pm5wnjq.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87tsz1k9z7.fsf@HIDDEN> <871pm5wnjq.fsf@HIDDEN>
Date: Tue, 11 Nov 2025 09:39:20 +0200
Message-ID: <871pm5hvbr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 79810
Cc: 79810 <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: -1.7 (-)

close 79810 31.0.50
thanks

> I found the bug, this patch should fix it:

Thanks for fixing this bug.  Now the patch is pushed.




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

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


Received: (at 79810) by debbugs.gnu.org; 10 Nov 2025 22:06:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 10 17:06:15 2025
Received: from localhost ([127.0.0.1]:40435 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vIa1f-0001JF-2I
	for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 17:06:15 -0500
Received: from mail-oa1-x42.google.com ([2001:4860:4864:20::42]:56667)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1vIa1a-0001Io-0Y
 for 79810 <at> debbugs.gnu.org; Mon, 10 Nov 2025 17:06:13 -0500
Received: by mail-oa1-x42.google.com with SMTP id
 586e51a60fabf-3d5bb03d5c2so2018868fac.1
 for <79810 <at> debbugs.gnu.org>; Mon, 10 Nov 2025 14:06:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762812364; x=1763417164; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=K+aDgIikFG4xdKtURxIAMtVsYXgvZn8KkvKVw8rF5Jw=;
 b=RagJ0bUm59HzEV6mafBsCIYEhN2p407jdicE2AzXnXO/BPA6HDLd6rwDa1obdQUkxt
 X3rcHOtv+YpuLAzlMSWdPpQ5dpZOTPyVF9odyxuERKZvvcFJsnKff4iX+sovJ0qnWyvs
 2BnMUmeMcARpnvrIH0HWc5bw67oJ/YULPfbZ/tCYMQb5mWmFs7qVBHwdjOg9IA5J5/RD
 YJ1XZmlRCJs3gAMVQb10+Ha+PxeSaJFicltde7JYS+eFgisSu5xxLAbGf6O1EO5hEbd0
 kY1ngZ0aF8ULv+dOD7oBbSxpfMSkuu1bsR4SaxofLg4lN31/j5nhogzDpnWieZ7G2RN7
 N8rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762812364; x=1763417164;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=K+aDgIikFG4xdKtURxIAMtVsYXgvZn8KkvKVw8rF5Jw=;
 b=HuR/1bIAXN6jstfW6vpgyxKGwF9UpaubgXzFq+8wld5osiLKAuM4cF3wJlY9/mUgqP
 y0SXCPg2iuQSToJJ8j7lMjfra5VwvzQ4CfLEWBXH7e5cZN4IWxYLGhqPdyiv1bw8cMS7
 UZKadTevPvfurL/E9l1Bko9Kx7mY2jZpDyG64ikMEZP4N/6yZXuqSibNG0ryACp8xbC/
 cdHbsZrBgWu4kHCg/l5YL2Jdbpnsk6kwhGYxR1zeYBvhf9+mdv82vxwOy9w/9XsU5blU
 QD0TjDiYVq/RqcXIpC4AHg2INo8cwkGPUwBvq3b77nzImNrkhN/h7K05jxqK+OLYcNqI
 YtHg==
X-Gm-Message-State: AOJu0YwnwNYTsrawKJc2qQ2W52I8A+71is2QPyXvFiJBtgeNENy+LDTZ
 TpkdVfkJJp3ey03OjXagX/UmbvZ7X43zPMxnlRAdkUCLrlG5EI50qmd0u2b034fB
X-Gm-Gg: ASbGnctnHpexd8OAFF6VnpGg2N4ITu7+gGBbZteWjyf0ZzW6CufTTJrF2U+76qd9aO9
 jWnZCmC54YUTzvi+a9PlFp/uLT//FiMncaWNLx/5MpzDNayRCxXgXQSz+djf8D9FB22hDu5gUAe
 z37pkFgjPiij2anpmSpnGi9wboARvqQy5s9SfCBnYSImdceaY8c3eeedkbxntwadlxNDdiQthbN
 5A26KWjiAhCl3ARuOCKKNcyLAXWrcp7zu+a7T9Zd1HLocZRkhKrxQA6UFiEhr/e0JkqbEbibbGZ
 M87n4V/il11sGc8xR9oApnfOnugL943QdpF7TDTI8t/4JhCRSGZvCmFAHDUTGWp1tLLFt2GpxS1
 AHibIb9uGjqXUe1BCfnxCmaFLrdCb2Wbd+pxyonM6jU4sBlaM9StMKpKxuF9xEVgT5aI7HVZ6d3
 qy1LgbglSf4Bj94w==
X-Google-Smtp-Source: AGHT+IG39kFGVlIJUH15JbSxbfSoTue1eyn1j+bE3TIiT+aOZRu23d9qFxhHRllCG+l4pHxxDqoSIw==
X-Received: by 2002:a05:6870:71d5:b0:3d3:672f:85b with SMTP id
 586e51a60fabf-3e7c28b17c4mr5686364fac.51.1762812363696; 
 Mon, 10 Nov 2025 14:06:03 -0800 (PST)
Received: from fedora ([189.215.165.71]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7c6f0b17f2fsm6273985a34.0.2025.11.10.14.06.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Nov 2025 14:06:03 -0800 (PST)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#79810: hideshow: Indicators missing for same-line multi-blocks
In-Reply-To: <87tsz1k9z7.fsf@HIDDEN>
References: <87tsz1k9z7.fsf@HIDDEN>
Date: Mon, 10 Nov 2025 16:06:01 -0600
Message-ID: <871pm5wnjq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 79810
Cc: 79810 <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: -0.7 (/)

--=-=-=
Content-Type: text/plain

Juri Linkov <juri@HIDDEN> writes:

> We have a problem in hideshow when a line contains more than 1 block.
>
> For example in c-ts-mode:
>
> #include <stdio.h>
> int main(int argc, char* argv[]) {
>   for (int i = 0; i < argc; i++) {
>     printf("%s\n", argv[i]);
>   }
>   return 0;
> }
>
> There is no hideshow indicator for the second line
> because the argument list is not hideable, so the 
> the opening bracket for the function body is ignored
> on the same line.
>
> When the curly bracket on the next line,
> then the indicator is shown:
>
> int main(int argc, char* argv[])
> {
>   for (int i = 0; i < argc; i++) {
>
> The same problem exists for go-ts-mode
> and other modes with similar syntax.

I found the bug, this patch should fix it:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-hideshow-Fix-indicators-for-multiple-block-in-the-sa.patch

From e1874d86783f5a15b19a525c61aaa0f6f1740ed4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 10 Nov 2025 15:46:19 -0600
Subject: [PATCH] hideshow: Fix indicators for multiple block in the same line

bug#79810

* lisp/progmodes/hideshow.el (hs-hideable-region-p): Simplify.
(hs-block-positions): Change return value.
(hs--add-indicators): Go to the next line only if we have
successfully created the overlays.
(hs-hide-block-at-point, hs-hide-block): Update code.
---
 lisp/progmodes/hideshow.el | 58 ++++++++++++++++++++++----------------
 1 file changed, 34 insertions(+), 24 deletions(-)

diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index af5d7a5b19e..06bc0c6e36d 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -678,11 +678,16 @@ hs-discard-overlays
         (delete-overlay ov))))
   (hs--refresh-indicators from to))
 
-(defun hs-hideable-region-p (beg end)
-  "Return t if region in BEG and END can be hidden."
+(defun hs-hideable-region-p (&optional beg end)
+  "Return t if region in BEG and END can be hidden.
+If BEG and END are not specified, it will try to check at the current
+block at point."
   ;; Check if BEG and END are not in the same line number,
   ;; since using `count-lines' is slow.
-  (< beg (save-excursion (goto-char end) (line-beginning-position))))
+  (if (and beg end)
+      (< beg (save-excursion (goto-char end) (line-beginning-position)))
+    (when-let* ((block (hs-block-positions)))
+      (apply #'hs-hideable-region-p block))))
 
 (defun hs-make-overlay (b e kind &optional b-offset e-offset)
   "Return a new overlay in region defined by B and E with type KIND.
@@ -724,7 +729,7 @@ hs-make-overlay
 
 (defun hs-block-positions ()
   "Return the current code block positions.
-This returns a cons-cell with the current code block beginning and end
+This returns a list with the current code block beginning and end
 positions.  This does nothing if there is not a code block at current
 point."
   (save-match-data
@@ -754,7 +759,7 @@ hs-block-positions
             (setq block-end
                   (or (funcall hs-adjust-block-end-function block-beg)
                       block-end)))
-          (cons block-beg block-end))))))
+          (list block-beg block-end))))))
 
 (defun hs--make-indicators-overlays (beg)
   "Helper function to make the indicators overlays."
@@ -824,9 +829,9 @@ hs--add-indicators
                            (point))))
                 ;; Check if block is longer than 1 line.
                 (_ (hs-hideable-region-p b-beg b-end)))
-      (hs--make-indicators-overlays b-beg))
-    ;; Only 1 indicator per line
-    (forward-line 1))
+      ;; Only 1 indicator per line
+      (when (hs--make-indicators-overlays b-beg)
+        (forward-line))))
   `(jit-lock-bounds ,beg . ,end))
 
 (defun hs--refresh-indicators (from to)
@@ -947,8 +952,8 @@ hs-hide-block-at-point
   (if comment-reg
       (hs-hide-comment-region (car comment-reg) (cadr comment-reg) end)
     (when-let* ((block (hs-block-positions)))
-      (let ((p (car-safe block))
-            (q (cdr-safe block))
+      (let ((p (car block))
+            (q (cadr block))
             ov)
         (if (hs-hideable-region-p p q)
             (progn
@@ -1229,7 +1234,8 @@ hs-hide-block
 `hs-hide-hook' is run.  See documentation for `run-hooks'."
   (interactive "P")
   (hs-life-goes-on
-   (let ((c-reg (funcall hs-inside-comment-predicate)))
+   (let ((c-reg (funcall hs-inside-comment-predicate))
+         (pos (point)))
      (cond
       ((and c-reg (or (null (nth 0 c-reg))
                       (not (hs-hideable-region-p (car c-reg) (nth 1 c-reg)))))
@@ -1238,20 +1244,24 @@ hs-hide-block
       (c-reg (hs-hide-block-at-point end c-reg))
 
       ((or (and (eq hs-hide-block-behavior 'after-bol)
-                (save-excursion
-                  (goto-char (line-beginning-position))
-                  (funcall hs-find-next-block-function hs-block-start-regexp
-                           (line-end-position) nil))
+                (setq pos (point))
+                (goto-char (line-beginning-position))
+                (catch 'hs--exit-hide
+                  (while (and (funcall hs-find-next-block-function
+                                       hs-block-start-regexp
+                                       (line-end-position) nil)
+                              (save-excursion
+                                (goto-char (match-beginning 0))
+                                (if (hs-hideable-region-p)
+                                    (throw 'hs--exit-hide t)
+                                  t)))))
                 (goto-char (match-beginning 0)))
-           (funcall hs-looking-at-block-start-predicate))
-       ;; If hiding the block fails (due the block is not hideable)
-       ;; then just hide the parent block (if possible)
-       (unless (save-excursion (hs-hide-block-at-point end))
-         (goto-char (1- (point)))
-         (funcall hs-find-block-beginning-function)
-         (hs-hide-block-at-point end)))
-
-      ((funcall hs-find-block-beginning-function)
+           (and (goto-char pos)
+                (funcall hs-looking-at-block-start-predicate)))
+       (hs-hide-block-at-point end))
+
+      ((and (goto-char (line-beginning-position))
+            (funcall hs-find-block-beginning-function))
        (hs-hide-block-at-point end)))
 
      (run-hooks 'hs-hide-hook))))
-- 
2.51.1


--=-=-=
Content-Type: text/plain



-- 
- E.G via Gnus and Org.

--=-=-=--




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

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


Received: (at submit) by debbugs.gnu.org; 10 Nov 2025 18:42:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 10 13:42:33 2025
Received: from localhost ([127.0.0.1]:39238 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vIWqW-0001aB-TB
	for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 13:42:33 -0500
Received: from lists.gnu.org ([2001:470:142::17]:52036)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vIWqT-0001Zz-JE
 for submit <at> debbugs.gnu.org; Mon, 10 Nov 2025 13:42:30 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1vIWpv-0002AS-Uw
 for bug-gnu-emacs@HIDDEN; Mon, 10 Nov 2025 13:42:00 -0500
Received: from mout-p-201.mailbox.org ([80.241.56.171])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1vIWpt-0001Sb-TW
 for bug-gnu-emacs@HIDDEN; Mon, 10 Nov 2025 13:41:55 -0500
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4d4z614JPMz9v6q
 for <bug-gnu-emacs@HIDDEN>; Mon, 10 Nov 2025 19:41:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1762800105;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=1ILhbG6No0vlA92YfouYH3i+Q4Wvzk85t22c7t214mI=;
 b=MMy0aOT507ePtMFQj2E9SHCQUOyuDgD3NHTR+7L1FzLZKT+aol9ZKB84uGwv0jb0qbOynB
 4rrooGapQtc3c1QXujgVtZSmCni/cH5T4g1Vt0FPGGXEop4QEkbbIzYcf3ikIDeRUbc0i9
 LwQ8thBQKPmWsxwEReZnMteDmMjQ3WHC6ouRS7WhBSHJTSnEqV/4eiGKXW8Xg4ZkVbb50V
 v3VtsOPC64ZUKV7LbrStZ+bLN2bu6QpFABq3DytU0etPUJZnVPgy9aNbadSDVW4R03t3i/
 rjnhCGm2KLLI6SlSamZ44lOSFLhuMLJinpHHk+lshgDiLBjX4bAAWTMsdU5kvg==
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: hideshow: Indicators missing for same-line multi-blocks
Organization: LINKOV.NET
X-Debbugs-Cc: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Date: Mon, 10 Nov 2025 20:39:56 +0200
Message-ID: <87tsz1k9z7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=80.241.56.171; envelope-from=juri@HIDDEN;
 helo=mout-p-201.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
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: -0.0 (/)

We have a problem in hideshow when a line contains more than 1 block.

For example in c-ts-mode:

#include <stdio.h>
int main(int argc, char* argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
  return 0;
}

There is no hideshow indicator for the second line
because the argument list is not hideable, so the 
the opening bracket for the function body is ignored
on the same line.

When the curly bracket on the next line,
then the indicator is shown:

int main(int argc, char* argv[])
{
  for (int i = 0; i < argc; i++) {

The same problem exists for go-ts-mode
and other modes with similar syntax.




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to eg642616@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to eg642616@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#79810; 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: Tue, 11 Nov 2025 07:45:02 UTC

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