GNU logs - #78234, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow.  (bug#)
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 03:41:01 +0000
Resent-Message-ID: <handler.78234.B.174633001530384 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 78234 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.174633001530384
          (code B ref -1); Sun, 04 May 2025 03:41:01 +0000
Received: (at submit) by debbugs.gnu.org; 4 May 2025 03:40:15 +0000
Received: from localhost ([127.0.0.1]:47524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBQD8-0007tz-A4
	for submit <at> debbugs.gnu.org; Sat, 03 May 2025 23:40:14 -0400
Received: from lists.gnu.org ([2001:470:142::17]:39766)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uBQCz-0007r3-Kg
 for submit <at> debbugs.gnu.org; Sat, 03 May 2025 23:40:11 -0400
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 <eg642616@HIDDEN>)
 id 1uBQCt-0004px-RK
 for bug-gnu-emacs@HIDDEN; Sat, 03 May 2025 23:39:59 -0400
Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uBQCr-0007sk-Rb
 for bug-gnu-emacs@HIDDEN; Sat, 03 May 2025 23:39:59 -0400
Received: by mail-oi1-x243.google.com with SMTP id
 5614622812f47-401e77e5443so2156676b6e.3
 for <bug-gnu-emacs@HIDDEN>; Sat, 03 May 2025 20:39:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746329996; x=1746934796; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=CchI9Db9DOpB7QyPRT6/QHoMBqcF5VL/U6t6AXWNutI=;
 b=Onnl6yPSqojB0C9ut+8fxOYG5mCa86P1pzzpHTOc/ecYzZEZTdrNlfQQZ7ZAZn/q28
 DA2kHChMBBQyQyvLz9LC9gX6n3IowmZD7jeici2kt+VwTZIj8HSGHiQYY73JSZZedZoj
 00SjYJUp77oefEeUCIxrx/SSj2M5vhYuR9EFh0mtlkgV/mkbELtI9LtNTHxDLhsqK5BX
 s+S8d2r4dFgHXg4ltapFMx6DsTbyrDDliAwo85KvhxKNzPeRz9FbkRGfPP/DlcQvR70a
 maXUfz+zOHKqF4S/gmtfzRKtm3WjKv48A/1GErur7Hh8UBwnvnUiMuSTFFBgg6llXqtv
 aA3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746329996; x=1746934796;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=CchI9Db9DOpB7QyPRT6/QHoMBqcF5VL/U6t6AXWNutI=;
 b=KjgYqapJd9pHoT42lmBYR1glIVXS/Vs9/a0a7bCGJR70EwaFJaUMyXUnPnz2Tx2Ka2
 a1pR9Llp8jqEsGqPIWBjEytK3JhTHXmid3GzH0OVbUZ6kqiiao46Z7r3wwmy12GO+Keh
 2Fw7gTkcl2EmEgj2afDQ9ZWjQL5M43mAhJ4YnweC5PW6ZwQ44yS/+x0WcOCe8V+J9miY
 nFHYZcYESSiKQ7voDDejwZma4lYWu7lJW52EXZwfNroqcRe2+Y1zeOc3DwffrCOtufcA
 ZtpCww/9fBkqxqnymXqVP+6lkhA8pEQgMCY3aKMcNJTKxLXKRy7FG7gA7MdOjIIB3oYL
 tNbw==
X-Gm-Message-State: AOJu0Yxb1mzt2GP8vU2U/D2CAR+BPO2OOiWZH0greVMJVN3E9ZLZPpx3
 81uTocfQPA5Fhnau3tUQ8mcvRY4863OFVMaAp20sZbIcyzlCugql5Z/P97ta
X-Gm-Gg: ASbGncv9V8YL7toAEmRYUC9lJPUf50zPWg9inB9OYfgmACABvKUsbu7qcfWqwQleEvp
 l/ESTuzwLTkoxVwuhG6bcr2dIeCr0ViuMsPzK27jAn1QmFYqkwBV3W9XaXOlV79tIx141pEAVz5
 yATn07Vrq2ff96+i4jf2hmZVqjU/u0Mmp/Qg2iZAHNxCEQOXRvZm+qzGO6aFzeCJjP87AE1IE4Z
 9gIM6eQM2d5hRjMMFTAHAC8JqnXkJ5YFYTIOe3BxsY8f5Hd0M/2O3wZUTOTLeJxh2HP7V3THwb7
 rKL8T3LK+svJQh1li4s=
X-Google-Smtp-Source: AGHT+IEgpJrdlWWz/fnHgwua3qZe1eswehoO82ZTKiCXbV6x5hkorOjhnqLx+7A//FrIzUzXvZr93Q==
X-Received: by 2002:a05:6808:3092:b0:401:f362:4bb2 with SMTP id
 5614622812f47-4035a5db11fmr1416781b6e.35.1746329995693; 
 Sat, 03 May 2025 20:39:55 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b33c::2]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-403573c572csm477107b6e.16.2025.05.03.20.39.54
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 03 May 2025 20:39:55 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sat, 03 May 2025 21:39:52 -0600
Message-ID: <87ecx582nr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::243;
 envelope-from=eg642616@HIDDEN; helo=mail-oi1-x243.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.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,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Tags: patch This patch allows to customize the ellipsis displayed
    when a block is hidden, by default it displays "=?UTF-8?Q?=E2=80=A6?=" (if possible) and fallback
    to "...". The ellipsis is now a button, If pressed it will unhide/unfold
   the block that was already hidden. 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
                             in digit (eg642616[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (eg642616[at]gmail.com)
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.2 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Tags: patch

This patch allows to customize the ellipsis displayed when a block is
hidden, by default it displays "=E2=80=A6" (if possible) and fallback to ".=
..".

The ellipsis is now a button, If pressed it will unhide/unfold the block
that was already hidden.

Also it can optionally display the total lines folded/hidden instead
displaying the ellipsis.
Thus, Instead display this:
  (defun fun (args) ...)

It will display:

  (defun fun (args) 2 lines...)



--=-=-=
Content-Type: text/patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-Prettify-and-improve-hideshow.-bug.patch
Content-Transfer-Encoding: quoted-printable

From d4aec4516e996364f0589cd8406e8cd31e63c76f Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Fri, 2 May 2025 22:44:07 -0600
Subject: [PATCH] Prettify and improve hideshow.  (bug#)

Buttonize the ellipsis and make it customizable.
Optionally instead display the ellipsis, display total lines
hidden.

* lisp/progmodes/hideshow.el (hs-ellipsis)
(hs-indicate-lines-hidden): New user options.
(hs-make-overlay): Tweak.
(hs-insert-ellipsis): New function.
* doc/emacs/programs.texi: Update documentation for new features.
* etc/NEWS: Announce changes.
---
 doc/emacs/programs.texi    | 11 +++++++++++
 etc/NEWS                   | 10 ++++++++++
 lisp/progmodes/hideshow.el | 38 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index f3cdc1b8e6c..8ec2964bf7b 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1668,6 +1668,8 @@ Hideshow
 @end table
=20
 @vindex hs-hide-comments-when-hiding-all
+@vindex hs-ellipsis
+@vindex hs-indicate-lines-hidden
 @vindex hs-isearch-open
 @vindex hs-special-modes-alist
   These variables can be used to customize Hideshow mode:
@@ -1677,6 +1679,15 @@ Hideshow
 If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
 comments too.
=20
+@item hs-ellipsis
+String to be used as ellipsis in hidden region.
+This option doesn't take effect if (@code{hs-indicate-lines-hidden})
+is non-@code{nil}.
+
+@item hs-indicate-lines-hidden
+If non-@code{nil}, display the total lines hidden.
+This overrides (@code{hs-ellipsis}).
+
 @item hs-isearch-open
 This variable specifies the conditions under which incremental search
 should unhide a hidden block when matching text occurs within the
diff --git a/etc/NEWS b/etc/NEWS
index d149a7387e2..240d764b826 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -689,6 +689,16 @@ Now 'treesit-explore-mode' (or 'treesit-explore') prom=
pts for a parser
 rather than a language, and it is now possible to select a local parser
 at point to explore.
=20
+** Hideshow mode changes
+
+*** New user option 'hs-ellipsis'.
+This option customize the ellipsis displayed in hidden blocks, this
+doesn't take effect if `hs-indicate-lines-hidden' is non-nil.
+
+*** New user option 'hs-indicate-lines-hidden'.
+This option, if non-nil, indicate total lines hidden and this is used
+instead 'hs-ellipsis'.  By default this is set to nil.
+
 ** C-ts mode
=20
 +++
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index c1d62fb92ab..9a5239751ab 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -232,6 +232,19 @@ hs-hide-comments-when-hiding-all
   "Hide the comments too when you do an `hs-hide-all'."
   :type 'boolean)
=20
+(defcustom hs-ellipsis
+  (if (char-displayable-p ?=E2=80=A6)
+      "=E2=80=A6"
+    "...")
+  "String to be used as ellipsis in hidden region.
+This option doesn't take effect if `hs-indicate-lines-hidden' is non-nil."
+  :type 'string)
+
+(defcustom hs-indicate-lines-hidden nil
+  "If non-nil, display the total lines hidden.
+This overrides `hs-ellipsis'."
+  :type 'boolean)
+
 (defcustom hs-minor-mode-hook nil
   "Hook called when hideshow minor mode is activated or deactivated."
   :type 'hook
@@ -528,8 +541,16 @@ hs-make-overlay
         (io (if (eq 'block hs-isearch-open)
                 ;; backward compatibility -- `block'<=3D>`code'
                 'code
-              hs-isearch-open)))
+              hs-isearch-open))
+        (map (make-sparse-keymap)))
     (overlay-put ov 'invisible 'hs)
+    (define-key map (kbd "<mouse-1>") #'hs-show-block)
+    (overlay-put ov 'display
+                 (propertize (hs-insert-ellipsis b e)
+                             'face 'custom-button
+                             'mouse-face 'custom-button-mouse
+                             'help-echo "mouse-1: unhide this"
+                             'keymap map))
     (overlay-put ov 'hs kind)
     (overlay-put ov 'hs-b-offset b-offset)
     (overlay-put ov 'hs-e-offset e-offset)
@@ -540,6 +561,21 @@ hs-make-overlay
     (when hs-set-up-overlay (funcall hs-set-up-overlay ov))
     ov))
=20
+(defun hs-insert-ellipsis (b e)
+  "Insert ellipsis on hidden region.
+If `hs-detailed-ellipsis' is non-nil, indicate the number of characters
+folded from B to E.
+Otherwise fallback to `hs-ellipsis' value."
+  (cond
+   (hs-indicate-lines-hidden
+    (let ((lines (1- (count-lines b e))))
+      (concat (number-to-string lines)
+              (if (=3D lines 1)
+                  " line"
+                " lines")
+              hs-ellipsis)))
+   (t hs-ellipsis)))
+
 (defun hs-isearch-show (ov)
   "Delete overlay OV, and set `hs-headline' to nil.
=20
--=20
2.49.0


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


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: bug#78234: Acknowledgement ([PATCH] Prettify and improve
 hideshow.  (bug#))
Message-ID: <handler.78234.B.174633001530384.ack <at> debbugs.gnu.org>
References: <87ecx582nr.fsf@HIDDEN>
X-Gnu-PR-Message: ack 78234
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 78234 <at> debbugs.gnu.org
Date: Sun, 04 May 2025 03:41:01 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 78234 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
78234: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78234
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow.  (bug#)
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 05:45:07 +0000
Resent-Message-ID: <handler.78234.B78234.174633747830079 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78234 <at> debbugs.gnu.org
Received: via spool by 78234-submit <at> debbugs.gnu.org id=B78234.174633747830079
          (code B ref 78234); Sun, 04 May 2025 05:45:07 +0000
Received: (at 78234) by debbugs.gnu.org; 4 May 2025 05:44:38 +0000
Received: from localhost ([127.0.0.1]:49108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBS9W-0007p5-BT
	for submit <at> debbugs.gnu.org; Sun, 04 May 2025 01:44:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54342)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uBS9T-0007nU-1I
 for 78234 <at> debbugs.gnu.org; Sun, 04 May 2025 01:44:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uBS9N-0006ZM-J3; Sun, 04 May 2025 01:44:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=1x4TFzhCaaseHoU84+WgY3S+tQF195WHnhDNFhUE52U=; b=Y3YAQ7h6B+lPicIpc94G
 70h5X66jt8cwz/GldxofeXNNe9pl9xb+NuHXpN+x9GHVFJybFtvAgfYi/IHrcf2a2Tck6cBmKD6cu
 J20WQLYZlhBwCooaMYlEoySo3qu0evnB/fAWvnk70ms5ARw0Q7twLQvSFJHH4Kh6f+Mb0H9F2J6BJ
 qA9D8XVqflq+lqgxCIsPtvFBaWMQVGsciDi6ALIWp7NXYHkTCRHuuCAD+YiNXBsHXggr2CHZls0jP
 phlZjb6tYovQGI2JzlMGtmT5wUjPr1/DsorsHtTmSHE9QqDuROjUoNdZ7QIRByrjlZrcuinsgPP3S
 FbGWhbh5WwAtaQ==;
Date: Sun, 04 May 2025 08:44:26 +0300
Message-Id: <86a57thqv9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87ecx582nr.fsf@HIDDEN> (message from Elijah Gabe
 =?UTF-8?Q?P=C3=A9rez?= on Sat, 03 May 2025 21:39:52 -0600)
References: <87ecx582nr.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
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 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> Date: Sat, 03 May 2025 21:39:52 -0600
> 
> This patch allows to customize the ellipsis displayed when a block is
> hidden, by default it displays "…" (if possible) and fallback to "...".

Thanks.

I understand the default and its fallback, but why do we need to make
this customizable?

Also, shouldn't the test whether the ellipsis can be displayed be done
for a specific frame?  The same Emacs session could have several
frames, some text-only, other GUI, and only some of them could be
capable of displaying the ellipsis.  Testing this once, when the
package is loaded, might be suboptimal.

> +This option doesn't take effect if (@code{hs-indicate-lines-hidden})
> +is non-@code{nil}.

Double negation is usually not a good idea, as it makes the text
confusing and easy to misinterpret.

> +@item hs-indicate-lines-hidden
> +If non-@code{nil}, display the total lines hidden.
> +This overrides (@code{hs-ellipsis}).

It does?  Doesn't this show the ellipsis after the number of lines?

> +** Hideshow mode changes
> +
> +*** New user option 'hs-ellipsis'.
> +This option customize the ellipsis displayed in hidden blocks, this
               ^^^^^^^^^
"customizes"

> +doesn't take effect if `hs-indicate-lines-hidden' is non-nil.
> +
> +*** New user option 'hs-indicate-lines-hidden'.
> +This option, if non-nil, indicate total lines hidden and this is used
                            ^^^^^^^^
"indicates"

> +instead 'hs-ellipsis'.  By default this is set to nil.
   ^^^^^^^
"instead of"

> +(defcustom hs-ellipsis
> +  (if (char-displayable-p ?…)
> +      "…"
> +    "...")
> +  "String to be used as ellipsis in hidden region.
> +This option doesn't take effect if `hs-indicate-lines-hidden' is non-nil."
> +  :type 'string)

Each new defcustom should have a :version tag.

> +(defcustom hs-indicate-lines-hidden nil
> +  "If non-nil, display the total lines hidden.

This is too terse.  Display where?  And it doesn't even mention
hideshow, so could be interpreted as something very general.

> +    (overlay-put ov 'display
> +                 (propertize (hs-insert-ellipsis b e)
> +                             'face 'custom-button
> +                             'mouse-face 'custom-button-mouse
> +                             'help-echo "mouse-1: unhide this"

This is again too terse.  I suggest "mouse-1: show hidden lines"
instead.

> +(defun hs-insert-ellipsis (b e)
> +  "Insert ellipsis on hidden region.
> +If `hs-detailed-ellipsis' is non-nil, indicate the number of characters
> +folded from B to E.

This is inconsistent with the code and the variable names

> +Otherwise fallback to `hs-ellipsis' value."
             ^^^^^^^^
"fall back"

Also, a function that inserts something cannot "fall back to some
value", so rewording is in order here.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow.  (bug#)
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 07:03:02 +0000
Resent-Message-ID: <handler.78234.B78234.17463421345594 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78234 <at> debbugs.gnu.org
Received: via spool by 78234-submit <at> debbugs.gnu.org id=B78234.17463421345594
          (code B ref 78234); Sun, 04 May 2025 07:03:02 +0000
Received: (at 78234) by debbugs.gnu.org; 4 May 2025 07:02:14 +0000
Received: from localhost ([127.0.0.1]:49867 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBTMc-0001SA-Fe
	for submit <at> debbugs.gnu.org; Sun, 04 May 2025 03:02:14 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:57089)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uBTMZ-0001Qi-EP
 for 78234 <at> debbugs.gnu.org; Sun, 04 May 2025 03:02:12 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 8DE90442B8;
 Sun,  4 May 2025 07:02:03 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87ecx582nr.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87ecx582nr.fsf@HIDDEN>
Date: Sun, 04 May 2025 09:58:35 +0300
Message-ID: <87ldrcq2uc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejheeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepieffteejgeehffejuedtiefhudekgeejteekiefgveeuheetvdefgeekkeevkedunecukfhppeeluddruddvledruddthedruddujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeluddruddvledruddthedruddujedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeekvdefgeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
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 (-)

> This patch allows to customize the ellipsis displayed when a block is
> hidden, by default it displays "…" (if possible) and fallback to "...".
>
> The ellipsis is now a button, If pressed it will unhide/unfold the block
> that was already hidden.
>
> Also it can optionally display the total lines folded/hidden instead
> displaying the ellipsis.
> Thus, Instead display this:
>   (defun fun (args) ...)
>
> It will display:
>
>   (defun fun (args) 2 lines...)

Thanks, it's nice to add more features to hideshow.  I tested your patch,
and the only visual problem is that the button looks too heavy.
Would it be possible to make its appearance more subtle?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow. (bug#)
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 18:31:05 +0000
Resent-Message-ID: <handler.78234.B78234.17463834195690 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 78234 <at> debbugs.gnu.org
Received: via spool by 78234-submit <at> debbugs.gnu.org id=B78234.17463834195690
          (code B ref 78234); Sun, 04 May 2025 18:31:05 +0000
Received: (at 78234) by debbugs.gnu.org; 4 May 2025 18:30:19 +0000
Received: from localhost ([127.0.0.1]:59818 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBe6V-0001T1-5w
	for submit <at> debbugs.gnu.org; Sun, 04 May 2025 14:30:19 -0400
Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:43083)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uBe6P-0001PR-Ii
 for 78234 <at> debbugs.gnu.org; Sun, 04 May 2025 14:30:16 -0400
Received: by mail-qv1-xf42.google.com with SMTP id
 6a1803df08f44-6e8f06e13a4so59088736d6.0
 for <78234 <at> debbugs.gnu.org>; Sun, 04 May 2025 11:30:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746383407; x=1746988207; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=YtxPcGpwK/6iMXi9kvhmWk9vuUl53V+YR53Pwwo8ak8=;
 b=lttWBbk5sCS+kItmD5uPyFf9j2IpoEWZd9zZ5DzAf79n7I+K5TaxmwQM5X65jdD/r2
 C45osDMDE4J0AhMB78Ue7B7XNj9Ae+UAMhu74yBDvje//yVCGXsgJ7He2Sv5Ffr+iKHh
 uQ2Rk2G2xDoxcL/DNmkYM1MiN241hYQNuCFfRtEPdgV7JBSdwZKA4pqP3wsC0wJEGEYi
 fD9irUlMY0inBv6nmLn/bZ+BcBoZYks67zbGdKfsZzzcI3r6cCloGcyilS7reCE+nev4
 AVLTgo03gXfKq/Q0cZPKb68M3pagnXDNYolfGdoLJPzurcB/BXC3D35EFKMu/Ou0xcKF
 LCmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746383407; x=1746988207;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=YtxPcGpwK/6iMXi9kvhmWk9vuUl53V+YR53Pwwo8ak8=;
 b=focMS5vSdZhB1L8CLsExXpqZCGwh7hYHBLoJ6Z8zooiHv8UlbxISle7+Ba7/Kph0Hh
 wt/MaCDZi06eC5qlth5UqCnxyB2y+o5Q+yBBDu4r5rJQodz03WVKY0vXn8+y1NpxyAow
 cu8vqNnnRLXEQ5bKFJ7nFirSWM2okRMM+yLSuj5k+p/ZQQyOQMdPrn+xr0wW+8IXYjrd
 X1fZB6Q7wNJs1N1mkp/qwNxRPyjuNP7X5ceYsVysecKXH1TvuID0X3bD4lTz82TQcrGQ
 wJM+UY3E27OLD2Gek0YR0d98w/zw1Z5XZUVIKoqm1v/9lUkBf6qld/xf/XPvhRbAkhMJ
 b4+Q==
X-Gm-Message-State: AOJu0Yyb0Qc37j2e0NHVZxzbLXPcVixNKhycRMPHW6zrUYNTbHMVyoga
 bKRgYId4WN/oZua7Tw9MMoDXHITyUZboyvWlIwIXj1tBPKfNyzETbDMgQM3o+NSL9EUQsvq+au5
 poO+mmmxt+oP2/ZQiJVQ4Puo0NV9W4HFy
X-Gm-Gg: ASbGnctMZBqo6gasUrg/XXEJLYeOA92/PmKBLbjs9i5QQKGr1QmBFTQ1wFhatVmpeMh
 ZaRy8MtWksiwaFP+XEX5T65OLUFRliI1oHnjDeCYLwpRR3Kvcobwkkkhz1rdgZlUA5kN5qAjDj3
 vPfvG85Lt6RZQ6XdZKcYyKrGB16ec9M4XsFrTZUxGFHW/WvT5KG+zz
X-Google-Smtp-Source: AGHT+IEl1tLCiyiGX8KA/aoAk4IJ/jMoQXJItlDIBEklbBmPf8ivlNGll5JyaGI83i9fZsMtQHIBE3ZEUrDqc9tMtw4=
X-Received: by 2002:ad4:5bee:0:b0:6e8:903c:6e5b with SMTP id
 6a1803df08f44-6f50b2090damr191075486d6.9.1746383407508; Sun, 04 May 2025
 11:30:07 -0700 (PDT)
MIME-Version: 1.0
References: <87ecx582nr.fsf@HIDDEN> <87ldrcq2uc.fsf@HIDDEN>
In-Reply-To: <87ldrcq2uc.fsf@HIDDEN>
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sun, 4 May 2025 12:29:55 -0600
X-Gm-Features: ATxdqUHK5rhV7e8lkMPeXei5lxbblArp_CwmY06d2LuLSoT8glp9P-B3TRZBWD4
Message-ID: <CACnP4N+zYeC1R5Z_1d5A57ncnom_pKb1Z7M43cohSeb7WtnKow@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000a583a50634539271"
X-Spam-Score: 0.3 (/)
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 (/)

--000000000000a583a50634539271
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Juri Linkov <juri@HIDDEN> escribi=C3=B3:

> > This patch allows to customize the ellipsis displayed when a block is
> > hidden, by default it displays "=E2=80=A6" (if possible) and fallback t=
o "...".
> >
> > The ellipsis is now a button, If pressed it will unhide/unfold the bloc=
k
> > that was already hidden.
> >
> > Also it can optionally display the total lines folded/hidden instead
> > displaying the ellipsis.
> > Thus, Instead display this:
> >   (defun fun (args) ...)
> >
> > It will display:
> >
> >   (defun fun (args) 2 lines...)
>
> Thanks, it's nice to add more features to hideshow.  I tested your patch,
> and the only visual problem is that the button looks too heavy.
> Would it be possible to make its appearance more subtle?
>

It looks normal for me (maybe for the theme that I'm using), but what would
you suggest?,
creating new face for this? Or using `shadow` face instead?

>

--000000000000a583a50634539271
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN">juri@linkov=
.net</a>&gt; escribi=C3=B3:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; Th=
is patch allows to customize the ellipsis displayed when a block is<br>
&gt; hidden, by default it displays &quot;=E2=80=A6&quot; (if possible) and=
 fallback to &quot;...&quot;.<br>
&gt;<br>
&gt; The ellipsis is now a button, If pressed it will unhide/unfold the blo=
ck<br>
&gt; that was already hidden.<br>
&gt;<br>
&gt; Also it can optionally display the total lines folded/hidden instead<b=
r>
&gt; displaying the ellipsis.<br>
&gt; Thus, Instead display this:<br>
&gt;=C2=A0 =C2=A0(defun fun (args) ...)<br>
&gt;<br>
&gt; It will display:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0(defun fun (args) 2 lines...)<br>
<br>
Thanks, it&#39;s nice to add more features to hideshow.=C2=A0 I tested your=
 patch,<br>
and the only visual problem is that the button looks too heavy.<br>
Would it be possible to make its appearance more subtle?<br></blockquote></=
div></div><div dir=3D"auto"><br></div><div dir=3D"auto">It looks normal for=
 me (maybe for the theme that I&#39;m using), but what would you suggest?,<=
/div><div dir=3D"auto">creating new face for this? Or using `shadow` face i=
nstead?</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
</blockquote></div></div></div>

--000000000000a583a50634539271--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow. (bug#)
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 18:50:10 +0000
Resent-Message-ID: <handler.78234.B78234.174638457415812 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78234 <at> debbugs.gnu.org
Received: via spool by 78234-submit <at> debbugs.gnu.org id=B78234.174638457415812
          (code B ref 78234); Sun, 04 May 2025 18:50:10 +0000
Received: (at 78234) by debbugs.gnu.org; 4 May 2025 18:49:34 +0000
Received: from localhost ([127.0.0.1]:60187 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBeP8-00046y-8W
	for submit <at> debbugs.gnu.org; Sun, 04 May 2025 14:49:34 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:47333)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uBeP5-00046S-WC
 for 78234 <at> debbugs.gnu.org; Sun, 04 May 2025 14:49:33 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 87696438F4;
 Sun,  4 May 2025 18:49:24 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <CACnP4N+zYeC1R5Z_1d5A57ncnom_pKb1Z7M43cohSeb7WtnKow@HIDDEN>
Organization: LINKOV.NET
References: <87ecx582nr.fsf@HIDDEN> <87ldrcq2uc.fsf@HIDDEN>
 <CACnP4N+zYeC1R5Z_1d5A57ncnom_pKb1Z7M43cohSeb7WtnKow@HIDDEN>
Date: Sun, 04 May 2025 21:47:00 +0300
Message-ID: <87cycomcwr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeekleejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejkedvfeegseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhm
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
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 (-)

>> and the only visual problem is that the button looks too heavy.
>> Would it be possible to make its appearance more subtle?
>
> It looks normal for me (maybe for the theme that I'm using), but what would
> you suggest?,

I suggest to use the same face attributes as in this face:

  (defface flymake-end-of-line-diagnostics-face
    '((t :height 0.85 :box (:line-width -1)))
    "Face used for end-of-line diagnostics."
    :package-version '(Flymake . "1.3.5"))

It looks like a button, but still quite moderate, and looks like in other IDEs.

> creating new face for this? Or using `shadow` face instead?

A new customizable face is definitely needed since appearance
is a sensitive matter for users.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78234: [PATCH] Prettify and improve hideshow.  (bug#)
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 May 2025 21:31:02 +0000
Resent-Message-ID: <handler.78234.B78234.17463942334901 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78234
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78234 <at> debbugs.gnu.org
Received: via spool by 78234-submit <at> debbugs.gnu.org id=B78234.17463942334901
          (code B ref 78234); Sun, 04 May 2025 21:31:02 +0000
Received: (at 78234) by debbugs.gnu.org; 4 May 2025 21:30:33 +0000
Received: from localhost ([127.0.0.1]:33912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uBguu-0001Er-28
	for submit <at> debbugs.gnu.org; Sun, 04 May 2025 17:30:32 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:55495)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uBguj-0000jb-MZ
 for 78234 <at> debbugs.gnu.org; Sun, 04 May 2025 17:30:29 -0400
Received: by mail-ot1-x341.google.com with SMTP id
 46e09a7af769-72bb9725de1so737391a34.2
 for <78234 <at> debbugs.gnu.org>; Sun, 04 May 2025 14:30:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746394215; x=1746999015; 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=94O24TdD5LKdVSL6U8KpZWzf7CFbQ/XKvajJeTfS6rU=;
 b=PLMykgetejQKvjUrRXPsKXjXXO7nm8PpG3n/h/sdfBzQg/1yDuRdvSSw906RplwmXr
 nwWVEpGBqpbR+SxAHVM9d9VzIy3vyacDWtjOXQLT+KHs4ooryWoj6wt50C1K8Pf2PKn1
 9e7UkJq1BkBbfLi+MChMgPNXB9yWFGbDz7/Djcy4W8Ggb/ABig5kfbgdaLhJzNAkOD0a
 ITz4e2FzS96Jro6cwnI07PQD3RH44a5oR88DQZKtiOf2nRJjmP2haFImA7309P7dAX5b
 6493FUm/3l37lH/6PPDSomp7sCUwjxe5XsXdryp9qpnltsVPZd44zDnm+yQZsZd10KUB
 Dmkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746394215; x=1746999015;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=94O24TdD5LKdVSL6U8KpZWzf7CFbQ/XKvajJeTfS6rU=;
 b=uvNzNIW+FRxgfQT2T/n1Gx655YqCwFwghWJt0364YPcBZKk1F/ubE2pntVxlJVpWPC
 9HA/kx/HMLbd40QFIfyKj35lu+11Z/OP9D2RMUt+2OODkjyaj9oCLOyFw4j7lFrpjXiO
 ElyPclFQaWOL2XuaLRLoEI7IuiJOHb3O5u2S+GusIWqVFNQickeqPz7Ku8QrvqjCFCou
 YvmXOfW8OwSm7IOcX+tbzk1og7VYGOcA/1a6J0QDKGU4dVGaAj+Z8g2zcOX8uvXqmvru
 OnoOPbwC+Q48mECSa7p2DOqetLlCRgK1pva+zqlrHDBKtUkoqrNu1sCZWRjwLJWRlaqs
 Oq/A==
X-Gm-Message-State: AOJu0YxMs3n/8pLN12IeGR1rus5bWQFmc4qgg3OQmjNvKqYhAZmsjzYn
 drBZNehUqxxkG/gBJRfQ9K8hCCswWM1NuuJUzi0sNdw6hmc6A1y4QMTbmwhh
X-Gm-Gg: ASbGncu5OxITYt+ycHjmdPNbXn0RRIWdpXFTKEYH8ONCGjo9VkQgoghsMukjlBaHSWI
 AdW8bfSz8HQr0I/8N7VnAXHvVF42oube5/MzTCKrcpmpi1QP0omP2wKoGEqjYJiGdd8Qs/wJk+A
 hXNrYDU9Lhf2+/dFLRzj2HaRqGCXPVVnSo8T1yMPI3wLblYLJNkF7+TlQWTfxdB6enfVZQX4LA5
 w6CMHWlPF9Rapz8Zj7O9iOP+Lhv719XNvCBjWIFwekj8b4b3aHXVbJgnTrJswt5OguE618JxFCc
 srsgC1e0g2c2uzYHcIc=
X-Google-Smtp-Source: AGHT+IHVnnzUD2CQcfWM6rWbQdnXQRnQ1AS0lD9I1+2S4Ha4+8ShUidWyT3TMJk0no2GsGfA1Vo0mQ==
X-Received: by 2002:a05:6808:1506:b0:401:ea99:54b with SMTP id
 5614622812f47-4035a57736bmr3421881b6e.23.1746394215150; 
 Sun, 04 May 2025 14:30:15 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b33c::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-607e7fb6466sm1359098eaf.26.2025.05.04.14.30.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 04 May 2025 14:30:14 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <86a57thqv9.fsf@HIDDEN>
References: <87ecx582nr.fsf@HIDDEN> <86a57thqv9.fsf@HIDDEN>
Date: Sun, 04 May 2025 15:30:12 -0600
Message-ID: <87a57skqsb.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-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; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Elijah Gabe P=C3=A9rez <eg642616@HIDDEN>
>> Date: Sat, 03 May 2025 21:39:52 -0600
>>=20
>> This patch allows to customize the ellipsis displayed when a block is
>> hidden, by default it displays "=E2=80=A6" (if possible) and fallback to=
 "...".
>
> Thanks.
>
> I understand the default and its fallback, but why do we need to make
> this customizable?

I've seen some comments about changing the ellipsis displayed,
of course this can be customizable using `display-table-slot', but it's
conflictive, some minor modes can overwrite the display table (such as
whitespace-mode).

Also I don't see any issue making hideshow ellipsis customizable,
org-mode does the same.

> Also, shouldn't the test whether the ellipsis can be displayed be done
> for a specific frame?  The same Emacs session could have several
> frames, some text-only, other GUI, and only some of them could be
> capable of displaying the ellipsis.  Testing this once, when the
> package is loaded, might be suboptimal.

I've updated it to use by default "...".

>> +This option doesn't take effect if (@code{hs-indicate-lines-hidden})
>> +is non-@code{nil}.
>
> Double negation is usually not a good idea, as it makes the text
> confusing and easy to misinterpret.

Fixed.

>> +(defcustom hs-ellipsis
>> +  (if (char-displayable-p ?=E2=80=A6)
>> +      "=E2=80=A6"
>> +    "...")
>> +  "String to be used as ellipsis in hidden region.
>> +This option doesn't take effect if `hs-indicate-lines-hidden' is non-ni=
l."
>> +  :type 'string)
>
> Each new defcustom should have a :version tag.

I forgot, I was in a hurry to submit this patch.

>> +(defun hs-insert-ellipsis (b e)
>> +  "Insert ellipsis on hidden region.
>> +If `hs-detailed-ellipsis' is non-nil, indicate the number of characters
>> +folded from B to E.
>
> This is inconsistent with the code and the variable names

I've simplified the docstring.


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-Prettify-and-improve-hideshow.-bug-78234.patch
Content-Transfer-Encoding: quoted-printable

From aed9b61ecf26b946182a712d981a251905def22b Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D <eg6426=
16@HIDDEN>
Date: Fri, 2 May 2025 22:44:07 -0600
Subject: [PATCH] Prettify and improve hideshow.  (bug#78234)

Buttonize the ellipsis and make it customizable.
Optionally display in the ellipsis the total lines hidden.

* lisp/progmodes/hideshow.el (hs-ellipsis)
(hs-indicate-lines-hidden): New user options.
(hs-ellipsis): New face.
(hs-make-overlay): Tweak.
(hs-insert-ellipsis): New function.
* doc/emacs/programs.texi: Update documentation for new features.
* etc/NEWS: Announce changes.
---
 doc/emacs/programs.texi    | 10 +++++++++
 etc/NEWS                   |  9 ++++++++
 lisp/progmodes/hideshow.el | 45 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index f3cdc1b8e6c..524d2c078a7 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1668,6 +1668,8 @@ Hideshow
 @end table
=20
 @vindex hs-hide-comments-when-hiding-all
+@vindex hs-ellipsis
+@vindex hs-indicate-lines-hidden
 @vindex hs-isearch-open
 @vindex hs-special-modes-alist
   These variables can be used to customize Hideshow mode:
@@ -1677,6 +1679,14 @@ Hideshow
 If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
 comments too.
=20
+@item hs-ellipsis
+String to be used as ellipsis in hidden region.  If set to @code{nil}
+(by default), just use the standard three dots ``...''.
+
+@item hs-indicate-lines-hidden
+If non-@code{nil}, display the total lines hidden in the hideshow
+ellipsis.
+
 @item hs-isearch-open
 This variable specifies the conditions under which incremental search
 should unhide a hidden block when matching text occurs within the
diff --git a/etc/NEWS b/etc/NEWS
index d149a7387e2..bcaa6e683fa 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -689,6 +689,15 @@ Now 'treesit-explore-mode' (or 'treesit-explore') prom=
pts for a parser
 rather than a language, and it is now possible to select a local parser
 at point to explore.
=20
+** Hideshow mode changes
+
+*** New user option 'hs-ellipsis'.
+This option customizes the ellipsis displayed in hidden blocks.
+
+*** New user option 'hs-indicate-lines-hidden'.
+This option, if non-nil, indicates total lines hidden in the ellipsis.
+By default this is disabled.
+
 ** C-ts mode
=20
 +++
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index c1d62fb92ab..05808fd540a 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -228,10 +228,27 @@ hideshow
   :prefix "hs-"
   :group 'languages)
=20
+(defface hs-ellipsis
+  '((t :height 0.80 :box (:line-width -1)))
+  "Face used for hideshow ellipsis."
+  :version "31.1")
+
 (defcustom hs-hide-comments-when-hiding-all t
   "Hide the comments too when you do an `hs-hide-all'."
   :type 'boolean)
=20
+(defcustom hs-ellipsis nil
+  "String to be used as ellipsis in hidden region.
+If set to nil (by default), just use the standard three dots \"...\"."
+  :type '(choice (const :tag "Use default" nil)
+		 (string :tag "String" :value "=E2=80=A6"))
+  :version "31.1")
+
+(defcustom hs-indicate-lines-hidden nil
+  "If non-nil, display the total lines hidden in the hideshow ellipsis."
+  :type 'boolean
+  :version "31.1")
+
 (defcustom hs-minor-mode-hook nil
   "Hook called when hideshow minor mode is activated or deactivated."
   :type 'hook
@@ -528,8 +545,16 @@ hs-make-overlay
         (io (if (eq 'block hs-isearch-open)
                 ;; backward compatibility -- `block'<=3D>`code'
                 'code
-              hs-isearch-open)))
+              hs-isearch-open))
+        (map (make-sparse-keymap)))
     (overlay-put ov 'invisible 'hs)
+    (define-key map (kbd "<mouse-1>") #'hs-show-block)
+    (overlay-put ov 'display
+                 (propertize (hs-insert-ellipsis b e)
+                             'face 'hs-ellipsis
+                             'mouse-face 'highlight
+                             'help-echo "mouse-1: show hidden lines"
+                             'keymap map))
     (overlay-put ov 'hs kind)
     (overlay-put ov 'hs-b-offset b-offset)
     (overlay-put ov 'hs-e-offset e-offset)
@@ -540,6 +565,24 @@ hs-make-overlay
     (when hs-set-up-overlay (funcall hs-set-up-overlay ov))
     ov))
=20
+(defun hs-insert-ellipsis (b e)
+  "Insert ellipsis on hidden region."
+  (cond*
+   ((bind*
+     (ellipsis
+      (if (and hs-ellipsis
+               (not (string-empty-p hs-ellipsis)))
+          hs-ellipsis
+        "..."))))
+   (hs-indicate-lines-hidden
+    (let ((lines (1- (count-lines b e))))
+      (concat (number-to-string lines)
+              (if (=3D lines 1)
+                  " line"
+                " lines")
+              ellipsis)))
+   (t ellipsis)))
+
 (defun hs-isearch-show (ov)
   "Delete overlay OV, and set `hs-headline' to nil.
=20
--=20
2.49.0


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


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--





Last modified: Sun, 4 May 2025 21:30:03 UTC

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