GNU bug report logs - #80657
[PATCH 1/2] hideshow: New user option 'hs-cycle-filter-function'

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: Elijah Gabe Pérez <eg642616@HIDDEN>; Keywords: patch; 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 80657 <at> debbugs.gnu.org and Elijah Gabe Pérez <eg642616@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 80657) by debbugs.gnu.org; 12 Apr 2026 17:47:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 12 13:47:53 2026
Received: from localhost ([127.0.0.1]:48803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wByuW-00023m-QI
	for submit <at> debbugs.gnu.org; Sun, 12 Apr 2026 13:47:53 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171]:47078)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1wByuT-00023V-Lj; Sun, 12 Apr 2026 13:47:51 -0400
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 4ftyfy6XTnz9tVG;
 Sun, 12 Apr 2026 19:47:38 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1776016059;
 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=g0HDgDDXrAlVtO5+sm53BYijmYSEaPf4ztNJpSvZ//4=;
 b=gP3CzV3OkuqIbd0Tk3EDexjOTHNR5Bv8iNj0A8mdXok8f4Z9iihBqZp0eiG3NpX4kwXRH7
 NBUhmu8GZfDSEnBK8ePJYRcHZvbaMUe7jLxq2xPWDwUSuu+fVxCIev0/lc3ErV4gc9npr6
 vSHbyhFOlHC/PA3uIXLdBPC8SBd07dOBZ9ic0nCBcmED2258Rerx+FiwQVsi3Cbkya7xg2
 e+VyABpmHD/LCJ5WEWY/jrlN0SuCNMnf/5I0CjhTgQoksDUs/7IP09NHZDGilA2hz7IbGE
 GkH+wlvjnWFejg4unsb+7qol1kY6Hd4eroRj7TAoKdTSOisOdSynivD5nIDl9w==
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87ika2jbqz.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN> <87fr5dqhto.fsf@HIDDEN>
 <s4ose9daqgn.fsf@HIDDEN> <874ilrreqo.fsf@HIDDEN>
 <87zf3h2qrf.fsf@HIDDEN> <87ika2jbqz.fsf@HIDDEN>
Date: Sun, 12 Apr 2026 20:46:12 +0300
Message-ID: <87ik9w9imz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, mbork@HIDDEN, 80657 <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 80657 31.0.50
thanks

>> it doesn't allow binding different keys to different commands
>> such as would be possible with a helper function:
>>
>>   (hs-add-cycle-binding nil "TAB" #'hs-toggle-hiding)
>>   (hs-add-cycle-binding nil "M-c" #'hs-cycle)
>
> Yes, I think I will be a little more opinated about this and despite
> mbork's decision (I also prefer the `hs-add-cycle-binding` one), so if
> there are no problems, any more comments regarding this "previous" patch
> before pushing it to master?

While `hs-add-cycle-binding` is better than a variable,
it's still not perfect, but I have no idea what would be better.
So now your patch is pushed, thanks.




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

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


Received: (at 80657) by debbugs.gnu.org; 8 Apr 2026 04:51:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 08 00:51:27 2026
Received: from localhost ([127.0.0.1]:47499 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wAKsw-0001iZ-BX
	for submit <at> debbugs.gnu.org; Wed, 08 Apr 2026 00:51:27 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:60835)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1wAKst-0001iP-6S
 for 80657 <at> debbugs.gnu.org; Wed, 08 Apr 2026 00:51:24 -0400
Received: by mail-ot1-x341.google.com with SMTP id
 46e09a7af769-7dbce74e537so3139935a34.1
 for <80657 <at> debbugs.gnu.org>; Tue, 07 Apr 2026 21:51:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1775623882; x=1776228682; 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=J68Gn7D+0YHI5O8m0dofc8rlQoGtgN0oLfQBCRmSM/o=;
 b=Z3o042PQCoEzSIQ2/oG1vHIm9FpRR0mMRWCRTw8W0VehjNe6iVGSe7LtvqDBZ2GaTA
 /hUn5glIlNR8Yapdn0zfwamaBy+1hOr29VXDeOJAMrRFJnDubFrNrd7Z58P/RSrpBzcq
 8PU+DJct1WBxq8NxCmfrOGvofB/rkNkMOFwAjHmKcr5U0lF07RYsC88j7WN41TuKyJrs
 8eqfhdQLkSzInP5A6McHu/EfuqFM3kf3rBTOfDk9fpRynCYFoc5S9M0VicSYJbtFFGuI
 0MeeBIdwnqmO8trlUVgKCY1LzZb5WiWpoUYZqjlYk/XIlKfAAcXocRhhlItT4yB3UJlP
 6CuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1775623882; x=1776228682;
 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=J68Gn7D+0YHI5O8m0dofc8rlQoGtgN0oLfQBCRmSM/o=;
 b=HP2cpv1/iA7vaeU1dZgsUd1yM0tqP2Uavv8zOtbhXQkqTBPPVB2l9PM08gPZA3MTdQ
 i9193N8BinOuS4F/O8GLI7tAWk7gU6yOsvqCACr6aDkT/HwXWAeinJaikMfvcQhatpbi
 onmRL6NB+JiPrlQWb7dLAIBN7ISl645YqWO44x9CnSPp0zU+97jgCwVCjpV3pxAr2ViL
 Ask58Gb7ElQxeNtQJrSlIGKRqI9b6Z4qFJQzcym8jGfxnrnBDuREFbBUlFxmug7fkEUf
 WHZFl0OZMioHqD+jvDzGE9LYCoNo+DAMDWbWryNNAO5jHBS/HPsT9Cj6xdH906sO4dBB
 Nc0w==
X-Forwarded-Encrypted: i=1;
 AJvYcCUbVgWSDYKWLoXMoABIyspEVg/fbXpG/SEhXX3l+IKpbrShGlOS+bxqQ2E1rkpavjmqguUaJA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyqxewzqPuSp4uPn8y5nVvvAX1awezL3OPjPlyIUZov4224+3tH
 jCKbkKzJ5muCtl68SQxQgeV2eL6JLFkKY8cTdFJUuo5dXUDsb5h6/Gb4oF9qzJS2BY4=
X-Gm-Gg: AeBDieunI2+GJNeNTIt6N+2JMmHrTGNvpYjOrco68KbF5GH0nS/0kGH1EyXGHvaWIC+
 XUVIk6LASUbMSX+euMmyHZa9DUJPkxAIhAxSYrZtU06noxCEz5KbV2k8E91Nqx5uKW9MYFXdhuo
 /g3sf/cE/TLnmPGCzuj0Et5cktN9wP8Lwn1fUbnWA6y/xC9T+FRj1zVVap5uroxKqA53BCe8UIc
 uTP3dfcgQHbMbnnvwt0CWNrdeYfCxN3A3TEe+bkHFsODrF/Q34ulKCXJr9ZOZRLkVaG27nNc8Eu
 2d7GB08KisfevfXv17rLdgRROPhb7V038IAvnvPp8K7Yb97RaPfzTMMDrbj+KTGsuwZaUpvEx2O
 4pqoM3qWWgJYodOvAl2CUhyqhPi/gf3vI6P7f0cower+cUL9sFDzU4NKPzF+4f+pytgCsTMI/2K
 TeR30J9PXkQeU=
X-Received: by 2002:a05:6830:4103:b0:7d7:45eb:4e23 with SMTP id
 46e09a7af769-7dbb755b9e9mr11415072a34.26.1775623882046; 
 Tue, 07 Apr 2026 21:51:22 -0700 (PDT)
Received: from gabe ([200.77.20.165]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7dbfc1cb11csm2183466a34.3.2026.04.07.21.51.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 07 Apr 2026 21:51:21 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87zf3h2qrf.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN> <87fr5dqhto.fsf@HIDDEN>
 <s4ose9daqgn.fsf@HIDDEN> <874ilrreqo.fsf@HIDDEN>
 <87zf3h2qrf.fsf@HIDDEN>
Date: Tue, 07 Apr 2026 22:51:16 -0600
Message-ID: <87ika2jbqz.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: 1.3 (+)
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: Juri Linkov writes: >> Thanks. I definitely prefer the former
 (`hs-cycle-filter-function' >> variable). > > `hs-cycle-filter-function'
 has several problems. > First the name: it's really not a filter function,
 > but a co [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:341 listed in]
 [list.dnswl.org]
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, mbork@HIDDEN, 80657 <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.3 (/)

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

Juri Linkov <juri@HIDDEN> writes:

>> Thanks.  I definitely prefer the former (`hs-cycle-filter-function'
>> variable).
>
> `hs-cycle-filter-function' has several problems.
> First the name: it's really not a filter function,
> but a command binding.  Second: it doesn't allow
> binding different keys to different commands
> such as would be possible with a helper function:
>
>   (hs-add-cycle-binding nil "TAB" #'hs-toggle-hiding)
>   (hs-add-cycle-binding nil "M-c" #'hs-cycle)

Yes, I think I will be a little more opinated about this and despite
mbork's decision (I also prefer the `hs-add-cycle-binding` one), so if
there are no problems, any more comments regarding this "previous" patch
before pushing it to master?


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-hideshow-New-function-hs-add-cycle-binding-Bug-80657.patch

From ec5d6c4a518108ce194e08187006e8e07f972db4 Mon Sep 17 00:00:00 2001
From: Elias Gabriel Perez <eg642616@HIDDEN>
Date: Wed, 11 Mar 2026 20:34:39 -0600
Subject: [PATCH] hideshow: New function 'hs-add-cycle-binding' (Bug#80657)

https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

* lisp/progmodes/hideshow.el (hs-cycle-filter)
(hs-minor-mode-map): Update.
(hs--filter-function, hs-add-cycle-binding): New functions.
(hs-cycle): Minor rework.
---
 lisp/progmodes/hideshow.el | 52 +++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 993ff1cd6f5..34a3fe97da3 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -436,17 +436,16 @@ hs-set-up-overlay
 (defcustom hs-cycle-filter nil
   "Control where typing a \\`TAB' cycles the visibility.
 This option determines on which parts of a line where a block
-begins \\`TAB' will be bound to visibility-cycling commands such
-as `hs-toggle-hiding'.  The value t means you can type \\`TAB'
-anywhere on a headline.  The value nil means \\`TAB' always has its
-usual binding.  The value can also be a function of no arguments,
-then \\`TAB' will invoke the visibility-cycling commands where that
-function returns non-nil.  For example, if the value is `bolp',
-those commands will be invoked at the headline's beginning.
+begins \\`TAB' will be bound to visibility-cycling commands.
+The value t means you can type \\`TAB' anywhere on a headline.  The
+value nil means \\`TAB' always has its usual binding.  The value can
+also be a function of no arguments, then \\`TAB' will invoke the
+visibility-cycling commands where that function returns non-nil.  For
+example, if the value is `bolp', those commands will be invoked at the
+headline's beginning.
 This allows to preserve the usual bindings, as determined by the
 major mode, elsewhere on the headlines.
-Currently it affects only the command `hs-toggle-hiding' by default,
-but it can be easily replaced with the command `hs-cycle'."
+See also `hs-add-cycle-binding' to change the function to use."
   :type `(choice (const :tag "Nowhere" nil)
                  (const :tag "Everywhere on the headline" t)
                  (const :tag "At block beginning" hs-hideable-block-p)
@@ -537,18 +536,6 @@ hs-minor-mode-map
   :doc "Keymap for hideshow minor mode."
   "S-<mouse-2>" #'hs-toggle-hiding
   "C-c @" hs-prefix-map
-  "TAB" `(menu-item
-          "" hs-toggle-hiding
-          :filter
-          ,(lambda (cmd)
-             (when (and hs-cycle-filter
-                        ;; On the headline with hideable blocks
-                        (save-excursion
-                          (forward-line 0)
-                          (hs-get-first-block-on-line))
-                        (or (not (functionp hs-cycle-filter))
-                            (funcall hs-cycle-filter)))
-               cmd)))
   "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding)
 
 (defvar-keymap hs-indicators-map
@@ -556,6 +543,17 @@ hs-indicators-map
   "<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hiding
   "<mouse-1>" #'hs-toggle-hiding)
 
+(defun hs-add-cycle-binding (keymap key definition)
+  "Define KEY for `hs-cycle-filter'.
+KEYMAP, KEY and DEFINITION are the same arguments as the ones of
+`keymap-set'."
+  (keymap-set (or keymap hs-minor-mode-map) key
+              `(menu-item
+                "" ,definition
+                :filter hs--filter-function)))
+
+(hs-add-cycle-binding nil "TAB" #'hs-toggle-hiding)
+
 (easy-menu-define hs-minor-mode-menu hs-minor-mode-map
   "Menu used when hideshow minor mode is active."
   '("Hide/Show"
@@ -976,6 +974,17 @@ hs-hide-level-recursive
 
 ;;;; Internal functions
 
+(defun hs--filter-function (cmd)
+  "Function used for `hs-cycle-filter' and `hs-add-cycle-binding'."
+  (when (and hs-cycle-filter
+             ;; On the headline with hideable blocks
+             (save-excursion
+               (forward-line 0)
+               (hs-get-first-block-on-line))
+             (or (not (functionp hs-cycle-filter))
+                 (funcall hs-cycle-filter)))
+    cmd))
+
 (defun hs--discard-overlay-before-changes (o &rest _r)
   "Remove overlay O before changes.
 Intended to be used in `modification-hooks', `insert-in-front-hooks' and
@@ -1441,6 +1450,7 @@ hs-cycle
 If LEVEL is specified (interactively, the prefix numeric argument), hide
 only blocks which are that many levels below the level of point."
   (interactive "p")
+  (setq level (or level 1)) ; For non-interactive calls
   (hs-life-goes-on
    (when-let* ((ret (hs-get-near-block :include-comments)))
      (cond ((eq ret 'comment)
-- 
2.51.0


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


-- 
- E.G via GNU Emacs (sent via GNUS).

--=-=-=--




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

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


Received: (at 80657) by debbugs.gnu.org; 5 Apr 2026 18:43:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 05 14:43:06 2026
Received: from localhost ([127.0.0.1]:33789 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w9SR7-0001Av-Ow
	for submit <at> debbugs.gnu.org; Sun, 05 Apr 2026 14:43:06 -0400
Received: from mout-p-103.mailbox.org ([80.241.56.161]:52792)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1w9SR2-0001AC-Oq
 for 80657 <at> debbugs.gnu.org; Sun, 05 Apr 2026 14:43:04 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (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-103.mailbox.org (Postfix) with ESMTPS id 4fphCx2nw5z9tKf;
 Sun,  5 Apr 2026 20:42:53 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1775414573;
 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=QIEyWJ3OWkAGJZMH/VERVYL9GTb7jQFVn8qDeGallcs=;
 b=SuZtBmggs2a8yuEBbUsuC1TvgAFS8dFOXiN5+xLz7BBsS1hhSDL9zU94eCyPmKedSA/w1/
 Nd1m1CLIkN2L/ajqzdBsEh3wSlyJXjHBZfGt3M4Y/LJ1Su/+xlaUrwWh7ZN6Ump3CDH3EH
 CMJZA23ST0SZE2vfOzDjzbyu2inT0kB5lYcyTy/3jPYrMsXY/vJPVIcVhf0coMSUHzsIa8
 WSwWplsQKiRGNbmV1GkEuha1KjKxX0K+icpaxXBFBtqUVf+aiWs/aRLUdu1GS0kDc/oU7F
 H5aXGQ3tcykoWoP9UL2vEL03EcSCswGhb5lP9oSMKG4fyyJD7NkGliklJ/Kn1w==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::202 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: mbork@HIDDEN
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <874ilrreqo.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN> <87fr5dqhto.fsf@HIDDEN>
 <s4ose9daqgn.fsf@HIDDEN> <874ilrreqo.fsf@HIDDEN>
Date: Sun, 05 Apr 2026 21:42:12 +0300
Message-ID: <87zf3h2qrf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4fphCx2nw5z9tKf
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 80657
Cc: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 80657 <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 (-)

>> The first one is using a variable to change only the command to use in
>> `hs-cycle-filter`:
>>
>>   (setq hs-cycle-filter-function #'hs-cycle)
>>
>> And the other one is using a function alla `define-key` to change
>> the command and the keybinding to use:
>>
>>   (hs-add-cycle-binding nil "TAB" #'hs-cycle) ; To change the command to use.
>>
>>   ;; or
>>
>>   (keymap-unset hs-minor-mode-map "TAB") ; To disable the key.
>>   (hs-add-cycle-binding nil "M-c" #'hs-cycle) ; To change the command and
>>                                               ; keybinding to use
>
> Thanks.  I definitely prefer the former (`hs-cycle-filter-function'
> variable).

`hs-cycle-filter-function' has several problems.
First the name: it's really not a filter function,
but a command binding.  Second: it doesn't allow
binding different keys to different commands
such as would be possible with a helper function:

  (hs-add-cycle-binding nil "TAB" #'hs-toggle-hiding)
  (hs-add-cycle-binding nil "M-c" #'hs-cycle)




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

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


Received: (at 80657) by debbugs.gnu.org; 3 Apr 2026 20:06:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 03 16:06:05 2026
Received: from localhost ([127.0.0.1]:34419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w8kmK-0007F5-Hi
	for submit <at> debbugs.gnu.org; Fri, 03 Apr 2026 16:06:05 -0400
Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:39539)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mbork@HIDDEN>) id 1w8kmI-0007E4-1a
 for 80657 <at> debbugs.gnu.org; Fri, 03 Apr 2026 16:06:02 -0400
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfout.phl.internal (Postfix) with ESMTP id 9FAB4EC0017;
 Fri,  3 Apr 2026 16:05:56 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-06.internal (MEProxy); Fri, 03 Apr 2026 16:05:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbork.pl; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1775246756;
 x=1775333156; bh=iStZpWQXxW+KNpzFDnRaBl7tAbk753asKeFSBt/QrXE=; b=
 BBWalM6mIleXzVwq6B21xH883FuEdbNRc6IP5CPvgdqBDCRtsVEbewLaO12UCYBA
 zeI/3bW57N0xnUFnUW1VH+r80G21/tZOmlVuTXsGmvPlkQORANhhRUq5cED4dIDK
 K/LHwoKPZKfQjUZJ+jGWY7bl04Xkvsrs8GvDL2aDtUR6QBYmPau+Tw9zQfCQSfC/
 l/hV8lTsK7TeO/uMQsbcwRhFyCUJE4NhNufttsJPZXJQUH4D+kNZALDdUi2crLkb
 NKVcnxGrEEz0BSREAjRny/Zj4B7V2St3petegxkEuPzUdLXYF13z2DDRUksCR2Eq
 StGhOGpY/mqZIzyZMIfjoQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775246756; x=
 1775333156; bh=iStZpWQXxW+KNpzFDnRaBl7tAbk753asKeFSBt/QrXE=; b=d
 90a6IqoRIYiAdLJLuPVFLXwefvAQohxsJ6Tvzu8PtI1Dhd5t5gR5m8+lBM/u/pEy
 +hCUNp8IxR5JkZlzTKjeq2bn5Io2pvIWbHsKiliuh92q6uj7wgjaNIYpGxftvR0X
 1L6+jatZf1a+5nh9NtVwZX5ObRZGmULGtP+iPe1wkY2GMeL3OaZx/waV1Dwmzvsx
 Qi4Eo3haO417tptFoZW+XLiDjJne6MM0/ItrfRaaj2cQ896XUlyXDp+Cbblrw1Kt
 WnYGXYGbF+FTo/a39aQUTBcxevQN7zzCo7UBlrZj3F4haVckR/pf8x1muJny11vH
 dRnoDF8rV2a1uFbX/gOmQ==
X-ME-Sender: <xms:pB3QaQfXE__mA4d6P8PJj2tCeawjGexoRIlWj-dRseefYYAzVEUwbg>
 <xme:pB3QaZOYRR5RYlV08JBF2quptmLnAksF9nRQQf56stujDeJ-Scnvaw1Q5IUK1smXE
 Pr9bmtzadoR2plwI4EWYgjkFpPT0b3zo5oUUX6ysPdPcw6U26i1BD2k>
X-ME-Received: <xmr:pB3QaWgWJPpnjRqG49W36toKhESLdicD5if452sWD7aBhenUuE-9cf613sY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdelkeeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi
 lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh
 ephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpehmsghorhhksehm
 sghorhhkrdhplhenucggtffrrghtthgvrhhnpeeikedugfekfeekteehuedtgfeuieelke
 efuedvtdelhedvvddvteegtdelgeegteenucffohhmrghinhepmhgsohhrkhdrphhlnecu
 vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsohhrkh
 esmhgsohhrkhdrphhlpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdp
 rhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomhdprhgtphhtthhopegvlh
 hiiiesghhnuhdrohhrghdprhgtphhtthhopeektdeiheejseguvggssghughhsrdhgnhhu
 rdhorhhgpdhrtghpthhtohepjhhurhhisehlihhnkhhovhdrnhgvth
X-ME-Proxy: <xmx:pB3QaU0If56xkas3hjfOosVmNRdHe78X3HsNEcfvH2WYaZYJfGOAlg>
 <xmx:pB3QaYjsyLeZovTGLGMH6DVl_5_WuWkoVaeNZdrnsoBqsCoi5BJ-Xw>
 <xmx:pB3QacczBRFfkVD5Pvw8t9cZJDkidmcV_Dab4VNMpcj9u-tSXsV8Ew>
 <xmx:pB3QaTnpGsF-o2CNmOGhzQp6SwXRyKDjrUatJcJgGiXhtJ6iG2CUsA>
 <xmx:pB3QaaMBCV8ClAKDYKDQq3GXOyhSuOTIcZdFQGxeXQ8tLApmT0K-Wdf->
Feedback-ID: i2bc64816:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 3 Apr 2026 16:05:55 -0400 (EDT)
From: mbork@HIDDEN
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <s4ose9daqgn.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN> <87fr5dqhto.fsf@HIDDEN>
 <s4ose9daqgn.fsf@HIDDEN>
User-Agent: mu4e 1.12.15; emacs 31.0.50
Date: Fri, 03 Apr 2026 22:05:51 +0200
Message-ID: <874ilrreqo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, 80657 <at> debbugs.gnu.org,
 Juri Linkov <juri@HIDDEN>
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 (-)

On 2026-04-02, at 17:32, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wrote:

> mbork@HIDDEN writes:
>
>> On 2026-04-01, at 15:39, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wro=
te:
>>
>>> But I think it's best to let mbork comment on which one is
>>> preferable.
>>
>> Sorry for not remembering exactly the alternative, but what are the
>> choices?
>
> The first one is using a variable to change only the command to use in
> `hs-cycle-filter`:
>
>   (setq hs-cycle-filter-function #'hs-cycle)
>
> And the other one is using a function alla `define-key` to change
> the command and the keybinding to use:
>
>   (hs-add-cycle-binding nil "TAB" #'hs-cycle) ; To change the command to =
use.
>
>   ;; or
>
>   (keymap-unset hs-minor-mode-map "TAB") ; To disable the key.
>   (hs-add-cycle-binding nil "M-c" #'hs-cycle) ; To change the command and
>                                               ; keybinding to use

Thanks.  I definitely prefer the former (`hs-cycle-filter-function'
variable).

Best,

--=20
Marcin Borkowski
https://mbork.pl




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

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


Received: (at 80657) by debbugs.gnu.org; 2 Apr 2026 23:32:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 02 19:32:33 2026
Received: from localhost ([127.0.0.1]:49926 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w8RWa-00070L-67
	for submit <at> debbugs.gnu.org; Thu, 02 Apr 2026 19:32:32 -0400
Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:49581)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1w8RWW-0006zn-Gl
 for 80657 <at> debbugs.gnu.org; Thu, 02 Apr 2026 19:32:29 -0400
Received: by mail-ot1-x344.google.com with SMTP id
 46e09a7af769-7d7fdb922a5so1100543a34.3
 for <80657 <at> debbugs.gnu.org>; Thu, 02 Apr 2026 16:32:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1775172747; x=1775777547; darn=debbugs.gnu.org;
 h=content-transfer-encoding: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=tMa5jbRrKrGllC2WZ2daTnZr6hPvJiBYRCpjGudMdFs=;
 b=JYrzof/GBl7h3f6lz7fWUymTtWLbUTVsgxIwPzLKPQzmkdkD6aZjN+9Slkz/KgsK64
 7dTH/6ZkCr9CH2WQnbGck4UPl4hfNMMkYWPk2yb4xB5yZesHyOaocINYSQrhjP70AlNC
 W6OTXMmEZVj43R4NkwelG5k2eAHqDezGD69lFy8SvLS7fbQnFfa2RadDWlGsEOU7n+Bp
 fd+qVmS8pUcWzTOwkORjmM7+FS+6vwVI8WOjn8YlLvSsUR7XPjip4hfpJ5T8FcmahAMY
 blIWnqKDM+9Az39jqAc9Lbj65rbdxnIx1uQYLAO5kWrdnyt/uvjKq59aGvHi1yJ9anug
 7QHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1775172747; x=1775777547;
 h=content-transfer-encoding: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=tMa5jbRrKrGllC2WZ2daTnZr6hPvJiBYRCpjGudMdFs=;
 b=U4E55Rkr8SexacK8vUnecQAEjKkX8l7mtyfOfFtVSM6/lMQ/78hQPAW3zS/+MVEnhJ
 n6kVk5vvbCCEbrQ7LHrWJpH+YLzHyC1Aylt14339n+4Vr50gFjaqLqfxeEUgC3DIuXKc
 NZXkXMIaD6NI+0ytigsWUz7kqFCmxSuSz6SaWeNDAlqbVArva5Oe29XndBt42tVBJxn6
 ukxHAHEh+7GZMvqjinbu9bbwCmW64/e90Yl+bVYsdmojQ1Fe42bER7ZjZR2vjZ1zqcwH
 2ybErFJwnqcYIfkXNGyJutsXZsCAXoM9PuLUy8SCMUJM8TbtCDbkBa1QpkPG5W/ot15w
 GmSQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVOiUmpq1a31X1JaWLkiNRTCtEVILaOTjGBIysNEK4hnAdEsu9F+UY8algxKeVXRBhLtINfJA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwUHkiC+KPWvaisMWY4+uOiTFHI/QxhRr7u2JM8X/6qDHutLxbR
 QWRUQSNXqEfv5umBWzCypIYjFkqfAAMQ7fcqSMY9BnGsNPropbIqd2I7Z1CQidPI
X-Gm-Gg: ATEYQzzQ+eKP7LL9K83ZZtl93XBmnDyaWmBYV38uu7/P5CUh7wcQzmbjvZZ5KLhVHTd
 hnSrn5c/hO+KtOgKj0cQ+JvZZ5gASVAKNZMJWgDK2MBn2QK35BCiboc/XvV1YAKH/BhpJc18Ziw
 v8d/KpuTsZ4ZQdHpuurb/F4F9oUvme5ix3fgwn+ETp0JrqKOfPlr/z17IJQ1mL7lqvQKLrcbLc0
 Ixvme2KUiz1+T/3qwXkg/4x3nMfTJfxwqUftfzAEoUkpRUe7hqodYOcJKjLIGq3alKAJ1EOsb2o
 70JjeNn8gRXLkfcnSurnM2KFURJNA3DQKAg/Ui0pUrB/fvhureKJRKg8orZjQjtdRZfyuMNTAiM
 5RJelGVN/XyIQODOdeYw6kBuATp/cHrcnIrVZuYSIfOG95COtJBCjruZ2snOiSqTk/82Mc1rO76
 86+CrDQy3MwWxFnKhD
X-Received: by 2002:a05:6830:6011:b0:7d7:f146:8738 with SMTP id
 46e09a7af769-7dbb6f7200cmr976642a34.12.1775172747080; 
 Thu, 02 Apr 2026 16:32:27 -0700 (PDT)
Received: from localhost ([2806:10ae:e:11ad:35c0:759f:a117:29c8])
 by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7dba7126f1bsm3231660a34.4.2026.04.02.16.32.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Apr 2026 16:32:26 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: mbork@HIDDEN
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87fr5dqhto.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN> <87fr5dqhto.fsf@HIDDEN>
Date: Thu, 02 Apr 2026 17:32:24 -0600
Message-ID: <s4ose9daqgn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.3 (+)
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:  > On 2026-04-01, at 15:39, Elijah Gabe Pérez wrote: > >>
    But I think it's best to let mbork comment on which one is >> preferable.
    > > Sorry for not remembering exactly the alternative, but what ar [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:344 listed in]
                             [list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (eg642616[at]gmail.com)
  1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
                             headers
  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
                             in digit (eg642616[at]gmail.com)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, 80657 <at> debbugs.gnu.org,
 Juri Linkov <juri@HIDDEN>
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.3 (/)

mbork@HIDDEN writes:

> On 2026-04-01, at 15:39, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wrot=
e:
>
>> But I think it's best to let mbork comment on which one is
>> preferable.
>
> Sorry for not remembering exactly the alternative, but what are the
> choices?

The first one is using a variable to change only the command to use in
`hs-cycle-filter`:

  (setq hs-cycle-filter-function #'hs-cycle)

And the other one is using a function alla `define-key` to change
the command and the keybinding to use:

  (hs-add-cycle-binding nil "TAB" #'hs-cycle) ; To change the command to us=
e.

  ;; or

  (keymap-unset hs-minor-mode-map "TAB") ; To disable the key.
  (hs-add-cycle-binding nil "M-c" #'hs-cycle) ; To change the command and
                                              ; keybinding to use

--=20
- E.G. via GNUS on Android




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

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


Received: (at 80657) by debbugs.gnu.org; 2 Apr 2026 19:32:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 02 15:32:34 2026
Received: from localhost ([127.0.0.1]:46767 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w8NmM-0007U5-9v
	for submit <at> debbugs.gnu.org; Thu, 02 Apr 2026 15:32:34 -0400
Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:43867)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mbork@HIDDEN>) id 1w8NmJ-0007TV-Mt
 for 80657 <at> debbugs.gnu.org; Thu, 02 Apr 2026 15:32:32 -0400
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfout.phl.internal (Postfix) with ESMTP id 0F0BEEC00C0;
 Thu,  2 Apr 2026 15:32:26 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-06.internal (MEProxy); Thu, 02 Apr 2026 15:32:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbork.pl; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1775158346;
 x=1775244746; bh=oXOz8HU0CoewqMDmYebEC7IKMkiXpxPAjQmmYW8rc0s=; b=
 cnUvvgjpkzj4bQWKDvthoLm8f7RxuEGkztcI5nhKtwyVNc0PIH+HUQkTkLQpFXEV
 NWzQ57DBTu8BrRAIakDQMgJE/fJ6e7CT9rC2Et+Ph+ndOJykgrc0bYY2RsBmGdjD
 DVOpRadI8AGuc38j47ilf58GuSXE4K4gT8PQLwIrmlktNrGM6HbzzJ5XygISMgjj
 7DcY/og3cHufCYSphWtm3nbJWG0JFzrEemOyo6YSHe2pJK57z7bIUWaqunPB1llO
 dN03HAzkbTkrT86FdiEloVPeHoQ+AnT19jcQp6U8ivk4pFlvWmMf4TY3kxF898Mj
 JcFn3PyQQFBQPblz67lCbA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775158346; x=
 1775244746; bh=oXOz8HU0CoewqMDmYebEC7IKMkiXpxPAjQmmYW8rc0s=; b=E
 QZUj/xNlXvVW7Ns8keKU3dcJ7Tpk0eKOEWkrLekMe0uhmMjbWxxCM6tPdzpNUEXU
 ugGzdCxG/hBWefEJxZ/xvG4iW46Xcok70IJXSU31vb0MRuyGbAh3BmtUAFieaVso
 g8UbVZqQhoNFzvYZoYfQAoLKQVV5x/M38/nTXNbrPuXeTSSbCMQDLSChhEbrvRD2
 /soMqskS0B4N0Y5dABBmvu3LMLCJkT7fLXm8VqGm5MLXQUofPr+/Q/J2ccWOV5xH
 eDpoYTqjt8cL0ut+sXP9jFuxKlpt4pFES/SHbXIElu+VXHEDWLoWnqGOm9dEMxxp
 NwNk2W0ZnXTbBI5LLmxew==
X-ME-Sender: <xms:ScTOae1jjwu2y20mV3XpRE1EqCngQLRfFRNIwbom4-Kb0Rqy_4MRnQ>
 <xme:ScTOaYE6f8cSCsA3h4ufOAC4GLVHei2Uj25Oa3vE6opWc7q-X6oQoKXyW2Pughrra
 JiLlOBmLCpuwPLjRr1flHRVmcr6kT8jfUx-mdcdVHWHyFjDvoh7r18>
X-ME-Received: <xmr:ScTOab7ckXr53A5YCsnO11KF-kue3DhjHUOOIdFe0Nkb24UplJvVhsR5AMk>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeikeekucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi
 lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh
 ephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpehmsghorhhksehm
 sghorhhkrdhplhenucggtffrrghtthgvrhhnpeeikedugfekfeekteehuedtgfeuieelke
 efuedvtdelhedvvddvteegtdelgeegteenucffohhmrghinhepmhgsohhrkhdrphhlnecu
 vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsohhrkh
 esmhgsohhrkhdrphhlpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdp
 rhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomhdprhgtphhtthhopehjuh
 hriheslhhinhhkohhvrdhnvghtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhr
 tghpthhtohepkedtieehjeesuggvsggsuhhgshdrghhnuhdrohhrgh
X-ME-Proxy: <xmx:ScTOaeu-tVgnp01WA-yKpy9ZQdpNS6ACvpPefiad6B_rqXJY1JGLbA>
 <xmx:ScTOac6hzoaeTlEpuTlN8G_plC_Mcj9SK2SM8ovmUCdCkMMDZTpkyg>
 <xmx:ScTOaZVG2CedhAEyKZulVaBZ6rS_5KU1SiZf4u-jhmH4TpalNNE4uQ>
 <xmx:ScTOae_-xhVVpLV-B3jde5ZLgAQv-YNFqf6YtrdLHaXCuDVEZ9M7MQ>
 <xmx:SsTOaSndL8Srh5hjmH1FLb5MBumOl7zgccyPkDUIYs1E9n64HYQuVTxq>
Feedback-ID: i2bc64816:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 2 Apr 2026 15:32:24 -0400 (EDT)
From: mbork@HIDDEN
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87a4vm4ay1.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
 <87a4vm4ay1.fsf@HIDDEN>
User-Agent: mu4e 1.12.15; emacs 31.0.50
Date: Thu, 02 Apr 2026 21:32:19 +0200
Message-ID: <87fr5dqhto.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, 80657 <at> debbugs.gnu.org,
 Juri Linkov <juri@HIDDEN>
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 (-)

On 2026-04-01, at 15:39, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wrote:

> But I think it's best to let mbork comment on which one is preferable.

Sorry for not remembering exactly the alternative, but what are the choices?

Thanks,

--=20
Marcin Borkowski
https://mbork.pl




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

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


Received: (at 80657) by debbugs.gnu.org; 1 Apr 2026 21:39:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 01 17:39:47 2026
Received: from localhost ([127.0.0.1]:60531 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w83Hu-0001YX-D3
	for submit <at> debbugs.gnu.org; Wed, 01 Apr 2026 17:39:46 -0400
Received: from mail-oa1-x44.google.com ([2001:4860:4864:20::44]:57517)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1w83Hr-0001YK-Tp
 for 80657 <at> debbugs.gnu.org; Wed, 01 Apr 2026 17:39:45 -0400
Received: by mail-oa1-x44.google.com with SMTP id
 586e51a60fabf-417571c6083so138036fac.2
 for <80657 <at> debbugs.gnu.org>; Wed, 01 Apr 2026 14:39:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1775079582; x=1775684382; 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=Kls6j/ctfHw/gK4nei2f7nwIeAp62GXk2VYgPpFkGEg=;
 b=Y/MU4tfZRcbOnFoxKjdeI+/A2/DDxqGwP60B5YHXCzbuX4+5YgCKT2XJv9rHFEQNyV
 cK6yUQkNERRkQ+dIQBxuG7du0UglBZmUo0nZAHB1HfEtlxDZdt4h60V5bsGTEgOw4sm2
 5DJ5CfvrWDOg9VICNXiNxJisWtZhf+YN4Lp4pHXqhtmpl4C03yO3tGR0Ce+1BEt6S8TI
 NBbDPSuavA0XJYCy7PZ8CcHyhr1NRG1vMQNLIWxFS2u5Q51/tzvWesSPf7SVeNtTXPtd
 rLihz3ac/UCH15fZCSkeEIV0yiMvuJrrzONiqVqfUiQvV97goBktgW26CHDTpsv46SmC
 GQQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1775079582; x=1775684382;
 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=Kls6j/ctfHw/gK4nei2f7nwIeAp62GXk2VYgPpFkGEg=;
 b=BW0Q+aR/XTZ4lXOyiwEivwQx75Sz7pi8hJ4aS6wXebqUI1zEmkl9q9G139qXRD5buE
 JSqceMQtgzqluJbP1SM3cjkm+EAmIlnIrbWvsIjAy/ELHcFNAQryp40mbF/HLB/Xu96Z
 i4p6CRkTpRjvfCVnRl3A1Jnz6rP77KxAZRv95QTH1U4cA9rTUWnfPED5UjyCrMJLPN1j
 OYac7e8TXphgGhZKbQ6jBDWcC0y8vKBfVE2Mw9qVSRIeVol7ovW8ep0CKvXVD1MbBhrd
 XDGF0PBbXeXcULf1h5ecuHGHO2/inzTX8dh+qSTG+j/49URtLjHgylP7HPX5AH0Iv6Zl
 SEqQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVjLk3PB6XMNN2aJa0u5hum8KU7tXeQYVURuzDBY9LUWoqCDmLgHf7FAf7tQpLZkGnp4anvNw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxwCwcRJEZljJ4/TNvBQkpjqzOy54bmXmwiCm0RclSxrw67h5Dd
 YmT1RKx8EuV/+DcjD71lc3vh0rcGmHiSoYF657jIu8dsDT70BQkg04YbMuJXjeZcg3Q=
X-Gm-Gg: ATEYQzwNr2pIjO4uTGVarBCzbSaTLdTR13j99aDbAdHq+6KSFsbn8Floyjr1UqMr/Gs
 I5ToKBOkoiBrMe5Om5wNlKnr2Gn3Creo1AaK5AIFoqOac2W66B11mnQTY0LiLG+m4p/K1piw7og
 57ihevvtZwJXyGHN8zN2jk+Xr7Kogn65IdJWYM0T7IvdDhhfMNIrCWNm4EUS5R31sz+CSctnoNw
 xnnEt3GKwTYcZ7xWt6xsuW0BbbuU/+oPhjSKii4WzWtidzZ0sgZr2UkO9PrzZkZ/NnE8P0NJn5o
 LkNpti+fdIzwNfcQ4qw+JCFGrC3k6ewkIwda+RIomj59/aDu1qo22YfAswtIuqXFbugD3pOuBd8
 kAV6pX3gEsK5CnWYFa/7zJ/+BiKK7UUvyhBVsCnPyqV6jOil/iAZwXZkjgwrMCFtgI4l7eL0h7V
 2k9bUEHzSU0+k=
X-Received: by 2002:a05:6820:615:b0:67e:3630:aba0 with SMTP id
 006d021491bc7-67fabbf0fbdmr3097390eaf.2.1775079582590; 
 Wed, 01 Apr 2026 14:39:42 -0700 (PDT)
Received: from gabe ([200.77.20.165]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-422eb25c447sm831466fac.9.2026.04.01.14.39.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 01 Apr 2026 14:39:42 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, mbork@HIDDEN
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87wlysdmun.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN> <87wlysdmun.fsf@HIDDEN>
Date: Wed, 01 Apr 2026 15:39:34 -0600
Message-ID: <87a4vm4ay1.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: 1.3 (+)
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:  Juri Linkov writes: >> For now, this variable is temporary
 until a simpler way to modify them >> becomes available in the future. >
 > outline.el uses a helper function: > > (outline-minor-mode-cycle--bind map
 (kbd "TAB") [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:4860:4864:20:0:0:0:44 listed in] [list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, 80657 <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.3 (/)

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

Juri Linkov <juri@HIDDEN> writes:

>> For now, this variable is temporary until a simpler way to modify them
>> becomes available in the future.
>
> outline.el uses a helper function:
>
>   (outline-minor-mode-cycle--bind map (kbd "TAB") #'outline-cycle)
>   (outline-minor-mode-cycle--bind map (kbd "<backtab>") #'outline-cycle-buffer)
>
> Is this better?

Oh i didn't know about this, but the function seems to be only for internal
use only (because the double hyphen in the name).

I've made a similar function.

But I think it's best to let mbork comment on which one is preferable.

>> -               cmd)))
>> +               (funcall hs-cycle-filter-function)
>> +               ;; Avoid inserting strings when the function returns
>> +               ;; strings.
>> +               nil)))
>
> Why not return the symbol?  I mean just:
>
> -               cmd)))
> +               hs-cycle-filter-function)))

Because I had intended that (plain) functions could be used and not just
commands, anyways I've reverted this change.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-hideshow-New-function-hs-add-cycle-binding-Bug-80657.patch

From ec5d6c4a518108ce194e08187006e8e07f972db4 Mon Sep 17 00:00:00 2001
From: Elias Gabriel Perez <eg642616@HIDDEN>
Date: Wed, 11 Mar 2026 20:34:39 -0600
Subject: [PATCH] hideshow: New function 'hs-add-cycle-binding' (Bug#80657)

https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

* lisp/progmodes/hideshow.el (hs-cycle-filter)
(hs-minor-mode-map): Update.
(hs--filter-function, hs-add-cycle-binding): New functions.
(hs-cycle): Minor rework.
---
 lisp/progmodes/hideshow.el | 52 +++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 993ff1cd6f5..34a3fe97da3 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -436,17 +436,16 @@ hs-set-up-overlay
 (defcustom hs-cycle-filter nil
   "Control where typing a \\`TAB' cycles the visibility.
 This option determines on which parts of a line where a block
-begins \\`TAB' will be bound to visibility-cycling commands such
-as `hs-toggle-hiding'.  The value t means you can type \\`TAB'
-anywhere on a headline.  The value nil means \\`TAB' always has its
-usual binding.  The value can also be a function of no arguments,
-then \\`TAB' will invoke the visibility-cycling commands where that
-function returns non-nil.  For example, if the value is `bolp',
-those commands will be invoked at the headline's beginning.
+begins \\`TAB' will be bound to visibility-cycling commands.
+The value t means you can type \\`TAB' anywhere on a headline.  The
+value nil means \\`TAB' always has its usual binding.  The value can
+also be a function of no arguments, then \\`TAB' will invoke the
+visibility-cycling commands where that function returns non-nil.  For
+example, if the value is `bolp', those commands will be invoked at the
+headline's beginning.
 This allows to preserve the usual bindings, as determined by the
 major mode, elsewhere on the headlines.
-Currently it affects only the command `hs-toggle-hiding' by default,
-but it can be easily replaced with the command `hs-cycle'."
+See also `hs-add-cycle-binding' to change the function to use."
   :type `(choice (const :tag "Nowhere" nil)
                  (const :tag "Everywhere on the headline" t)
                  (const :tag "At block beginning" hs-hideable-block-p)
@@ -537,18 +536,6 @@ hs-minor-mode-map
   :doc "Keymap for hideshow minor mode."
   "S-<mouse-2>" #'hs-toggle-hiding
   "C-c @" hs-prefix-map
-  "TAB" `(menu-item
-          "" hs-toggle-hiding
-          :filter
-          ,(lambda (cmd)
-             (when (and hs-cycle-filter
-                        ;; On the headline with hideable blocks
-                        (save-excursion
-                          (forward-line 0)
-                          (hs-get-first-block-on-line))
-                        (or (not (functionp hs-cycle-filter))
-                            (funcall hs-cycle-filter)))
-               cmd)))
   "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding)
 
 (defvar-keymap hs-indicators-map
@@ -556,6 +543,17 @@ hs-indicators-map
   "<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hiding
   "<mouse-1>" #'hs-toggle-hiding)
 
+(defun hs-add-cycle-binding (keymap key definition)
+  "Define KEY for `hs-cycle-filter'.
+KEYMAP, KEY and DEFINITION are the same arguments as the ones of
+`keymap-set'."
+  (keymap-set (or keymap hs-minor-mode-map) key
+              `(menu-item
+                "" ,definition
+                :filter hs--filter-function)))
+
+(hs-add-cycle-binding nil "TAB" #'hs-toggle-hiding)
+
 (easy-menu-define hs-minor-mode-menu hs-minor-mode-map
   "Menu used when hideshow minor mode is active."
   '("Hide/Show"
@@ -976,6 +974,17 @@ hs-hide-level-recursive
 
 ;;;; Internal functions
 
+(defun hs--filter-function (cmd)
+  "Function used for `hs-cycle-filter' and `hs-add-cycle-binding'."
+  (when (and hs-cycle-filter
+             ;; On the headline with hideable blocks
+             (save-excursion
+               (forward-line 0)
+               (hs-get-first-block-on-line))
+             (or (not (functionp hs-cycle-filter))
+                 (funcall hs-cycle-filter)))
+    cmd))
+
 (defun hs--discard-overlay-before-changes (o &rest _r)
   "Remove overlay O before changes.
 Intended to be used in `modification-hooks', `insert-in-front-hooks' and
@@ -1441,6 +1450,7 @@ hs-cycle
 If LEVEL is specified (interactively, the prefix numeric argument), hide
 only blocks which are that many levels below the level of point."
   (interactive "p")
+  (setq level (or level 1)) ; For non-interactive calls
   (hs-life-goes-on
    (when-let* ((ret (hs-get-near-block :include-comments)))
      (cond ((eq ret 'comment)
-- 
2.51.0


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


--
- E.G via GNU Emacs (sent via GNUS).

--=-=-=--




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

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


Received: (at 80657) by debbugs.gnu.org; 31 Mar 2026 17:17:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 31 13:17:38 2026
Received: from localhost ([127.0.0.1]:40788 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w7cig-0002ut-70
	for submit <at> debbugs.gnu.org; Tue, 31 Mar 2026 13:17:38 -0400
Received: from mout-p-202.mailbox.org ([80.241.56.172]:44400)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1w7cid-0002uK-KM
 for 80657 <at> debbugs.gnu.org; Tue, 31 Mar 2026 13:17:36 -0400
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-202.mailbox.org (Postfix) with ESMTPS id 4flZYf03Bgz9tV5;
 Tue, 31 Mar 2026 19:17:26 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1774977446;
 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=8H8eTXAsuu0HjhcwejZIHAVe00IR3cUVxGmjTwfMtN8=;
 b=YQ1kFIVaADKnszDUmrmQwccoAsyiQc7fXvFoTAnUZW3xmKGx/9xHxF8aYIOo1wlMyYC8q8
 SX55fN2F6vN4u1clTSgMGzJbdPABZMrnay+W6c6cMpQSF6sezkxHeY4WRd0YdlyBF/OE7N
 Tv47vNyw/jK1PJz9IJ3wAHRSNkW5hgfOTy1qjYlUi9pNpJe/CBE8Sig2FCM80OcBnWXQl1
 rjp73kcH8Is+oCLeDlUUefzy2MM7QO/7rq6ddy4HHvSTcO7IJf9JZGRarW+JUkBilo2rgY
 617hwbxpylt2aMs0C6xxnj2Is7VW6E6d4vvyAUpWBbY8ZRYEpLFSND6cuYQHxw==
From: Juri Linkov <juri@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87o6kc3nln.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
 <87o6kc3nln.fsf@HIDDEN>
Date: Tue, 31 Mar 2026 19:45:20 +0300
Message-ID: <87wlysdmun.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.3 (+)
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:  >> Thanks,
 but I'm quite confused by the change and its effects.
 > > The reason for this is because modifying menu-item keybindings are hard,
 > and there is currently no cleaner way to do it without d [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [80.241.56.172 listed in sa-trusted.bondedsender.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [80.241.56.172 listed in list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [80.241.56.172 listed in bl.score.senderscore.com]
X-Debbugs-Envelope-To: 80657
Cc: Eli Zaretskii <eliz@HIDDEN>, mbork@HIDDEN, 80657 <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.3 (/)

>> Thanks, but I'm quite confused by the change and its effects.
>
> The reason for this is because modifying menu-item keybindings are hard,
> and there is currently no cleaner way to do it without duplicating code.
>
> For now, this variable is temporary until a simpler way to modify them
> becomes available in the future.

outline.el uses a helper function:

  (outline-minor-mode-cycle--bind map (kbd "TAB") #'outline-cycle)
  (outline-minor-mode-cycle--bind map (kbd "<backtab>") #'outline-cycle-buffer)

Is this better?

> -               cmd)))
> +               (funcall hs-cycle-filter-function)
> +               ;; Avoid inserting strings when the function returns
> +               ;; strings.
> +               nil)))

Why not return the symbol?  I mean just:

-               cmd)))
+               hs-cycle-filter-function)))




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

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


Received: (at 80657) by debbugs.gnu.org; 26 Mar 2026 19:47:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 15:47:42 2026
Received: from localhost ([127.0.0.1]:45239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w5qg9-00007N-Rf
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2026 15:47:42 -0400
Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]:52575)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mbork@HIDDEN>) id 1w5qg6-00006j-TT
 for 80657 <at> debbugs.gnu.org; Thu, 26 Mar 2026 15:47:40 -0400
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfout.stl.internal (Postfix) with ESMTP id 2DFBE1D00285;
 Thu, 26 Mar 2026 15:47:33 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-06.internal (MEProxy); Thu, 26 Mar 2026 15:47:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbork.pl; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1774554452;
 x=1774640852; bh=iDthD4li84SMa6xcEvxdCgZ6SSDxbMabj3GxODXYwr4=; b=
 PLpf24emLV9t8CV/vMLfCVXfV2WCEp/pee6vYEJaxGRnmnSBCnMdnohhQPnXzl2G
 wGl6EBSzfTNG++vQDqhjVxPPfPwWjt7Rvkkh1T4O4e8yLeOqkvLwjmIJkg/MIsxF
 W+dm3USZz7y8EP5qC3aWdW1qZozH2NaOU//39LN//fwwy2wucbF1jz5vOqhRf9SA
 WK+1s8mZGy/iSE9pByFU6AekJYeD2xN19pXDkO8Q5CnGIm+B2hU2HGz2fO8wyrGm
 18DddbGAh8TczynGjSnbuNUuMUl7lBKBQA9a100keMYsqZsmAW9FPMwbGELKAWCy
 HW+LYdZzOyVccwKPttKs0w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774554452; x=
 1774640852; bh=iDthD4li84SMa6xcEvxdCgZ6SSDxbMabj3GxODXYwr4=; b=k
 Q/2iXXBKxYFaaLUFZqA40csqfAWdKStEtCtbMTTAAmJ9lCL2WHTAqmBWpo1WEiXH
 omepDgZ/hfcOaBOxOCqs72Z5GDqHFkIx1Kp3OmgpDYA++TI0Rq7lM+IHvOt2646D
 KoybvrNSHMcPreAc9Plmf1GFlB0JRqr32DMTh3DIM0NvYFyNn7whq+H6ju60QjOT
 b58AMVDA155Cr22e/RVoZiqcVoTy+M1KYOXltP9b+xFD2wYOfEF1PTD+ZyEiZjfc
 43d0lJ3r+bHuUthzJ4MpSU+qarR7WEdQK9DKfz/fo9/gpQvcVkOKXxIJ9nIKTfRI
 ERe/m5KcxgaHX6PuhWQJw==
X-ME-Sender: <xms:VI3FadYKbt3MzrPm-H6ljb0EBtg1duAEVOpSrzYawZpeOccaIS5PHQ>
 <xme:VI3FaaaAco_e5-pMWYgThhHRkQzrVQLsbiSUVY1O-LVh4AgNgoOiexFn-q3OhHV4F
 RxaBYlE7IcN1aGYpxL2RggvBCGX7mf86Wg_haLoM55cj8fx-GCpBxzu>
X-ME-Received: <xmr:VI3FadngprRR5floGE7rZ66S23JKzRgSApjXzZQbs2vtDw_R-xQ4fBs75l4>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdekvdehucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpehmsghorhhk
 sehmsghorhhkrdhplhenucggtffrrghtthgvrhhnpeeikedugfekfeekteehuedtgfeuie
 elkeefuedvtdelhedvvddvteegtdelgeegteenucffohhmrghinhepmhgsohhrkhdrphhl
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgsoh
 hrkhesmhgsohhrkhdrphhlpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhu
 thdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomhdprhgtphhtthhope
 ektdeiheejseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:VI3FaWz79nYyrQ_hsd08O-rV94Dh2NzINkfySTBBH7DwsXkp4SLtcQ>
 <xmx:VI3FabOSYuYpV8tUM7ASxPljh9ThDj2YAxbipg89DMGjdi-PB2po4A>
 <xmx:VI3FaaQzYbyBwHl5fM-6BIY0Iil_ZLhpoTbK9LtUAK51RaO5DDOwMA>
 <xmx:VI3FaZYHjTh2sCRT14rFSZhVhRT9pe3asvV8qFuQSzBOJ-JSSek8nw>
 <xmx:VI3Fae3I4Cu37waONrupMD2sPTZWUIgXTqpewmdz8uj8G81_523_9B-h>
Feedback-ID: i2bc64816:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 26 Mar 2026 15:47:31 -0400 (EDT)
From: mbork@HIDDEN
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87jyv03n5l.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <87qzpb2ehj.fsf@HIDDEN>
 <87jyv03n5l.fsf@HIDDEN>
User-Agent: mu4e 1.12.15; emacs 31.0.50
Date: Thu, 26 Mar 2026 20:47:29 +0100
Message-ID: <87jyuymkz2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 80657
Cc: 80657 <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 (-)

On 2026-03-24, at 15:58, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wrote:

> Uhh No, It was actually the first thing that came to mind.  There is no
> "backstory" behind it.

I see, thanks.

--=20
Marcin Borkowski
https://mbork.pl




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

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


Received: (at 80657) by debbugs.gnu.org; 24 Mar 2026 21:58:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 17:58:35 2026
Received: from localhost ([127.0.0.1]:46740 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w59lj-0004XX-E1
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2026 17:58:35 -0400
Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:50576)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1w59lh-0004XQ-1o
 for 80657 <at> debbugs.gnu.org; Tue, 24 Mar 2026 17:58:33 -0400
Received: by mail-ot1-x343.google.com with SMTP id
 46e09a7af769-7d9bba96f7dso1480067a34.1
 for <80657 <at> debbugs.gnu.org>; Tue, 24 Mar 2026 14:58:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1774389512; x=1774994312; 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=s20NUf48W6LHsl1m+zmMZXPEvQnuGn4CZDvwGZG4GSE=;
 b=NJXHYDOcK+L5dSZzMwWDUcd+rHeaO8pf++2JtEkVFdmAh9R8sdBYiGUBpDTCIq8Ly5
 jDSCGJTHk2g046ZFDolZIuhV6EZgThc60jT+ARo7MnAS42WTwpVqR2A7SC+cnCXkfrYR
 Gc7jjxt8vCiVedOoXgXr56E5/2B0UCI9OwnAEnWUdR2AfFDn3HZBu1xl+nLN9D+ODSrr
 IgCVutvmmp1nJblBVNLkaW0jhtNqkdbu8wQbVcZP5C/QP0iKMHU02sGJa77p0ytsD4EQ
 fMMMyyhu0e4A9T0lz7bBGgRs91+4gef1pstMgMeZxodQPj28usMDrMXiR+EQJeuKnITT
 EYEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1774389512; x=1774994312;
 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=s20NUf48W6LHsl1m+zmMZXPEvQnuGn4CZDvwGZG4GSE=;
 b=ZCcNU/JkxL22KB+bWLGCfcH0OXfV6S7gLf46FSn89vQeHq2RBJVOTbOeSQNms0Vo45
 LWu0MFXVn4Z5nMVK9jEYixOeaw3XHHtEoaNXdC/jc4duCtku/ZdsuKn3nxc0wPkuKzgb
 BKk+hd0JfswDCUybe2uP4BuDFPecjwij9dcBk59F7+4eiVfSiKcoHd/OgZa2XKFDg6ME
 70YkR9sg0bT2Ddr2v38vIMCDHG2RyIFaQIVAcUOUoeT22N8c77opY/jvv8L/ENvW79pT
 Slod2XT7HyZeGAnBBTIYZ9reUP2dTTMAFjAgqXA7DznQljupIRpVKF0CS62u8wMcLduK
 NRRw==
X-Gm-Message-State: AOJu0YzAZEnRG9VPW8Jboo6ZLOY6cNWubogg39+JtZ1PraYgZUL75ZTl
 33rBdFZPnYrLYnL9vvo4i9FKH99VQzjufDUE9hCh2kDkVTyJDWxCzajpeXe+Yw8/pEg=
X-Gm-Gg: ATEYQzyqDsuhmXWEQDY/f0CL8IufpRMDcd2C7L+S1wtkKsgvQbg8A25FqUA394Nfq0T
 iWPiQT9IhHY2wpOigiFD7sBEw0yZb639eCfnZAqqCslhaOJbKMht/bfLGzrDZ8/BXKSQMc4GcVw
 SEt4Ek+4BGbdbz6GRLrlvTb/zSDG7RveYg2lQ9QSksuRor1lQ9Qpie/u7Tc+IIqOC4CXyeYU3k+
 PpBpA+J1Vv92ubVa4qpyRVv4x2OEwUNcvfYpd4kBcDVvYh4BPeRCQ0VaekcGtcnMrjKjxjGz3TA
 8+hfTe+h0VcVFnMxNBPtNOGrnt0l7W8qOhoRJpPiCxYhWuGAJ8P6P8rvqDkT9t0WzFKVyjqYgP5
 /ywiBZdzq3F51eBllD35r2ClHLIIsDVdYv1JKnH2oyN0y6aW5KJkClQVZeBYBUjmIZGVxQP98BU
 ibHnI4FUu8
X-Received: by 2002:a05:6830:6aee:b0:7d7:e9b7:7e69 with SMTP id
 46e09a7af769-7d9d67dd644mr571093a34.31.1774389512007; 
 Tue, 24 Mar 2026 14:58:32 -0700 (PDT)
Received: from gabe ([200.77.20.5]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7d7eadcb11csm13435215a34.13.2026.03.24.14.58.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Mar 2026 14:58:31 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: mbork@HIDDEN
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <87qzpb2ehj.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <87qzpb2ehj.fsf@HIDDEN>
Date: Tue, 24 Mar 2026 15:58:30 -0600
Message-ID: <87jyv03n5l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 1.3 (+)
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: > > Thanks a lot! > > One (very minor) question: > > (unless
 level (setq level 1)) ; For non-interactive calls > > > Is it superior to/more
 idiomatic than > > (setq level (or level 1)) > > or is it ju [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:343 listed in]
 [list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 80657
Cc: 80657 <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.3 (/)

mbork@HIDDEN writes:

>
> Thanks a lot!
>
> One (very minor) question:
>
> (unless level (setq level 1)) ; For non-interactive calls
>
>
> Is it superior to/more idiomatic than
>
> (setq level (or level 1))
>
> or is it just the question of preference?

Uhh No, It was actually the first thing that came to mind.  There is no
"backstory" behind it.

-- 
- E.G via GNU Emacs (sent via GNUS).




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

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


Received: (at 80657) by debbugs.gnu.org; 24 Mar 2026 21:49:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 17:49:00 2026
Received: from localhost ([127.0.0.1]:46724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w59cS-00043k-6L
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2026 17:49:00 -0400
Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:58850)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1w59cP-00043b-CJ
 for 80657 <at> debbugs.gnu.org; Tue, 24 Mar 2026 17:48:58 -0400
Received: by mail-ot1-x344.google.com with SMTP id
 46e09a7af769-7d8b2703f37so1508147a34.1
 for <80657 <at> debbugs.gnu.org>; Tue, 24 Mar 2026 14:48:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20251104; t=1774388936; x=1774993736; 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=FA5HalWEExS2GQtHf12RTw0Td2SoCfhVcJfIbFHbb9A=;
 b=TV4iyr1L0cqMCo4kz0iwVlOswsFafPQpBhIb6AwY5Phc/g3Q0usXljpsi8uptG4mAS
 GY5LYUvqBLGRfHR28f0bdT3442c/nWF693OUXpINpRyYFvFeN3sk1xFr/oNKqiNK0vlq
 748njV8DM/e2cDHMiaMMpplaSQwiVhtcb1nzXRIwuBSD/0DI0qOD61WtXDG3qnwW952K
 OJvfL55UBFLbaKO9wBCprLnvQk9XMxQ+nYCvJeEghjpB+S44/PBkrjKeLpmZ5qfnBzBz
 FHCI/5U/patY55CxJRaVjRq8pJlyg78Y4ODR1Lg403MyUFYzvhlzicCkogjGYP5QCNtb
 UNyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1774388936; x=1774993736;
 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=FA5HalWEExS2GQtHf12RTw0Td2SoCfhVcJfIbFHbb9A=;
 b=IrASytikFHsoHAXg8w0TU21z/nJz4f4iwowPXEmqru8JgokdWIhh1pyCWyxDe3+QDK
 /OKpyChTQuPG+5uvYW2gS+OMVsno6uvDkFsZzBIx5Zva1RlGT5Smv5n3zu6CyB4Kb7Nw
 r3RokEGE1gYvjOoC7hHeNnR5KsB11emP0OlLYzi+pRfgj5RszEZHO24X6u0hMwblrmXG
 yw+LJOuG9kkOnX0ZvsXv5cVfaPT+h57VxGlONkt8JRuYbL20FoczC7l/NBLsedJ8tGEs
 iHguSzIfwPwjJvO1HPiKIRENy0BtsvzQP9KcKhE0TJuuKh3RDBObrfp33fta8Ho5EAQm
 4gXA==
X-Forwarded-Encrypted: i=1;
 AJvYcCWxUKG3ePodgBuPpyRCD6Yl+/SGZ9KIu4f+jmlt9MnMqdkHGYTDJ2w2wXedcHSuioSBPMDlZA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyfGlmj5eg6qL8oDeksP6cLvKicKPQBJM0vr6BPYgN/gTEC4adX
 /xUtfNQ9NSKnKQwyCXWuAzITvv6sL7Mxr8Sty7xe0gaGl8NAjN6NFoey3VymlFvOYow=
X-Gm-Gg: ATEYQzwN7R+YhnKUOFp2yzQdDMH1hJazbIDt/iB2Ek9c9SHT0SyYhQD+rVevA80pHV8
 XYTTPDNgTVlKz06NcZs0/xi58o157/a2xmRGg6s0J65rlsoqTnHxUQOCLk3sH2qffPB2J9Det1T
 ExCWRH8WCFpHoxex60L2Fn/nAXG16c1G7osf2TDVjU/7YATZbN1bSwhY+FFQhRgk5Ht3RAt48zF
 g3fhdH+ltVjafRgwaTE2gTkx6XS+ndGMJ6bnqTnmnP8jp6HDaYGRuE0taXQBiMHjdftsEu+yyWe
 i//huoh3rXJaobW0YeR35K9lK0akmMhg20mNiFgJVNbyyGk545oPrzVSxGQ4pH3J2lT5Ou6f9+H
 kTtl3YEHEGdBeuVwjyMWaEv2MIK7gbacGNucOb7TDhmioMdOXZkyJj87zAKaCEyP5nAHk9wJamh
 FMY8LhZv/9
X-Received: by 2002:a05:6830:3e07:b0:7d9:b0d2:dabf with SMTP id
 46e09a7af769-7d9d695b4c7mr642918a34.22.1774388935769; 
 Tue, 24 Mar 2026 14:48:55 -0700 (PDT)
Received: from gabe ([200.77.20.5]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7d7eadd17d9sm14298111a34.14.2026.03.24.14.48.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Mar 2026 14:48:55 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
In-Reply-To: <86341q20lh.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN> <86341q20lh.fsf@HIDDEN>
Date: Tue, 24 Mar 2026 15:48:52 -0600
Message-ID: <87o6kc3nln.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: 1.3 (+)
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:  Eli Zaretskii writes: > Thanks, but I'm quite confused by
 the change and its effects. The reason for this is because modifying menu-item
 keybindings are hard, and there is currently no cleaner way to do it without
 duplicating code. 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2607:f8b0:4864:20:0:0:0:344 listed in]
 [list.dnswl.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 80657
Cc: mbork@HIDDEN, 80657 <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.3 (/)

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

Eli Zaretskii <eliz@HIDDEN> writes:

> Thanks, but I'm quite confused by the change and its effects.

The reason for this is because modifying menu-item keybindings are hard,
and there is currently no cleaner way to do it without duplicating code.

For now, this variable is temporary until a simpler way to modify them
becomes available in the future.

>> @@ -1788,6 +1789,10 @@ Hideshow
>>  binding.  The value @code{nil} means @key{TAB} cannot cycle the
>>  visibility of the blocks anywhere on the heading line.
>>
>> +@item hs-cycle-filter-function
>> +This variable specifies which function should be used in
>> +@code{hs-cycle-filter}.
>
> I don't see a need to document this in the user manual, unless you
> expect many users to want to customize it.

The only users I know that want to use it are me and mbork (for now).

I really don't think many people can be interested in this, but anyways,
I've removed it, the option is very simple.

>> +By default this calls to 'hs-cycle', use the new user option
>
> Please remove the "to" part, it's redundant.

Thanks, done.

>> +'hs-cycle-filter-function' to change the function to use.
>
> The default value of hs-cycle-filter-function is _not_ hs-cycle, so I
> wonder whether there's a mistake here or what am I missing?

Oops, i didn't notice this.  Fixed.

>> +(defcustom hs-cycle-filter-function #'hs-toggle-hiding
>> +  "Function to use in `hs-cycle-filter'."
>> +  :type 'function
>> +  :version "31.1")
>
> For a simple customization such as this one, do we really need to go
> via a function?  Why not have an additional special value of
> hs-cycle-filter to specify that hs-cycle is to be used instead of
> hs-toggle-hiding? This will be much more user-friendly, IMO, and is
> what the OP actually requested.  The possibility of specifying a
> function can stay, but we don't need to use it to provide this
> particular feature.

Because perhaps more people want support for more functions besides
`hs-cycle` or to use their own one.

I didn't added a "hs-cycle-filter-use-hs-cycle-command-instead", because
probably people want something different or complex that hs-cycle.

As a solution, i've added the `hs-cycle` option in the defcustom :type,
so users will know that hs-cycle can also be used.

I'm not sure if things like this deserve to be options or just plain
variables.

> In any case, the doc string should say something like
>
>   Function intended to be used as the value of `hs-cycle-filter'.

Thanks, added.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-hideshow-New-user-option-hs-cycle-filter-function-Bu.patch

From d4e86014db18999531d036f40eefaca5683d3bab Mon Sep 17 00:00:00 2001
From: Elias Gabriel Perez <eg642616@HIDDEN>
Date: Wed, 11 Mar 2026 20:34:39 -0600
Subject: [PATCH] hideshow: New user option 'hs-cycle-filter-function'
 (Bug#80657)

https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce new option.
* lisp/progmodes/hideshow.el (hs-cycle-filter): Rework.
(hs-cycle-filter-function): New user option.
(hs-minor-mode-map, hs-cycle): Update.
---
 doc/emacs/programs.texi    |  1 +
 etc/NEWS                   |  3 +++
 lisp/progmodes/hideshow.el | 32 +++++++++++++++++++++-----------
 3 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 57d3babef41..1636c1273a2 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1742,6 +1742,7 @@ Hideshow
 @vindex hs-indicator-maximum-buffer-size
 @vindex hs-isearch-open
 @vindex hs-hide-block-behavior
+@vindex hs-cycle-filter-function
 @vindex hs-cycle-filter
   These variables can be used to customize Hideshow mode:
 
diff --git a/etc/NEWS b/etc/NEWS
index c26baa03266..8de2abc94d2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1361,6 +1361,9 @@ after cursor position.  By default this is set to 'after-bol'.
 This user option controls the positions on the headline of hideable blocks
 where the 'TAB' key cycles the blocks' visibility.
 
+By default this calls 'hs-toggle-hiding', use the new user option
+'hs-cycle-filter-function' to change the function to use.
+
 ---
 *** The variable 'hs-special-modes-alist' is now obsolete.
 Instead of customizing Hideshow for a mode by setting the elements of
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 3043b04c5ad..aac1249c0f9 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -445,17 +445,16 @@ hs-set-up-overlay
 (defcustom hs-cycle-filter nil
   "Control where typing a \\`TAB' cycles the visibility.
 This option determines on which parts of a line where a block
-begins \\`TAB' will be bound to visibility-cycling commands such
-as `hs-toggle-hiding'.  The value t means you can type \\`TAB'
-anywhere on a headline.  The value nil means \\`TAB' always has its
-usual binding.  The value can also be a function of no arguments,
-then \\`TAB' will invoke the visibility-cycling commands where that
-function returns non-nil.  For example, if the value is `bolp',
-those commands will be invoked at the headline's beginning.
+begins \\`TAB' will be bound to visibility-cycling commands.
+The value t means you can type \\`TAB' anywhere on a headline.  The
+value nil means \\`TAB' always has its usual binding.  The value can
+also be a function of no arguments, then \\`TAB' will invoke the
+visibility-cycling commands where that function returns non-nil.  For
+example, if the value is `bolp', those commands will be invoked at the
+headline's beginning.
 This allows to preserve the usual bindings, as determined by the
 major mode, elsewhere on the headlines.
-Currently it affects only the command `hs-toggle-hiding' by default,
-but it can be easily replaced with the command `hs-cycle'."
+See also `hs-cycle-filter-function' to change the function to use."
   :type `(choice (const :tag "Nowhere" nil)
                  (const :tag "Everywhere on the headline" t)
                  (const :tag "At block beginning"
@@ -469,6 +468,13 @@ hs-cycle-filter
                  (function :tag "Custom filter function"))
   :version "31.1")
 
+(defcustom hs-cycle-filter-function #'hs-toggle-hiding
+  "Function intended to be used as the value of `hs-cycle-filter'."
+  :type '(choice (const :tag "Cycle hidding" hs-cycle)
+                 (const :tag "Toggle hidding (default)" hs-toggle-hiding)
+                 function)
+  :version "31.1")
+
 ;;;; Icons
 
 (define-icon hs-indicator-hide nil
@@ -540,7 +546,7 @@ hs-minor-mode-map
   "TAB" `(menu-item
           "" hs-toggle-hiding
           :filter
-          ,(lambda (cmd)
+          ,(lambda (_cmd)
              (when (and hs-cycle-filter
                         ;; On the headline with hideable blocks
                         (save-excursion
@@ -548,7 +554,10 @@ hs-minor-mode-map
                           (hs-get-first-block-on-line))
                         (or (not (functionp hs-cycle-filter))
                             (funcall hs-cycle-filter)))
-               cmd)))
+               (funcall hs-cycle-filter-function)
+               ;; Avoid inserting strings when the function returns
+               ;; strings.
+               nil)))
   "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding)
 
 (defvar-keymap hs-indicators-map
@@ -1433,6 +1442,7 @@ hs-cycle
 If LEVEL is specified (interactively, the prefix numeric argument), hide
 only blocks which are that many levels below the level of point."
   (interactive "p")
+  (setq level (or level 1))
   (hs-life-goes-on
    (when-let* ((ret (hs-get-near-block :include-comments)))
      (cond ((eq ret 'comment)
-- 
2.51.0


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


--
- E.G via GNU Emacs (sent via GNUS).

--=-=-=--




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

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


Received: (at 80657) by debbugs.gnu.org; 23 Mar 2026 12:26:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 23 08:26:49 2026
Received: from localhost ([127.0.0.1]:49101 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w4eMq-00069L-A9
	for submit <at> debbugs.gnu.org; Mon, 23 Mar 2026 08:26:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49142)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1w4eMm-00068w-DI
 for 80657 <at> debbugs.gnu.org; Mon, 23 Mar 2026 08:26:45 -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 1w4eMg-0000OP-OS; Mon, 23 Mar 2026 08:26:38 -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=4RvVIv9UPjcwixydUkAenyuuI/YhVkeeGNRskxbxIBc=; b=GzPPRyrlyaunFP/RBfuD
 WHHwN289jB+f2cFA+E2j8aV9Py+tuZz133YNnlwufNGuwvYZcJwqz8dIwUG2CN7zP4E+4pIYaUlIe
 U144UiNqbbJfk+4txbME3LjC5vgaTO4RVvEzo1BONdB4jj5GL+d3u6eoY1XGdqtv0SisOZJ2jCWPU
 1e+vnZ6zbPOSyeeXKiLb9+uL3Fy/8VjhY6GbvhRu9fVrkp1DHer4IHyPO7ppSWzQ5QWSLK5jerxD8
 qarbz2yozzGMxt1n2OO0sat85q5BH7nRNWaf58dUDTGCjq4vM8XXU7oy5isCpdEl7vMoq0KB0fIwn
 RhV4pCImcvqEmQ==;
Date: Mon, 23 Mar 2026 14:26:34 +0200
Message-Id: <86341q20lh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= <eg642616@HIDDEN>
In-Reply-To: <87h5q7bhp1.fsf@HIDDEN> (message from Elijah Gabe
 =?iso-8859-1?Q?P=E9rez?= on Sun, 22 Mar 2026 16:52:26 -0600)
Subject: Re: bug#80657: [PATCH 1/2] hideshow: New user option
 'hs-cycle-filter-function'
References: <87h5q7bhp1.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 80657
Cc: mbork@HIDDEN, 80657 <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 (---)

> Cc: mbork@HIDDEN
> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> Date: Sun, 22 Mar 2026 16:52:26 -0600
> 
> This patch adds a new option to change the function/command to use in
> `hs-cycle-filter`.
> 
> Resquested in:
> https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

Thanks, but I'm quite confused by the change and its effects.  So
please forgive me if something I write below makes no sense, and
please explain what did I miss.

> @@ -1788,6 +1789,10 @@ Hideshow
>  binding.  The value @code{nil} means @key{TAB} cannot cycle the
>  visibility of the blocks anywhere on the heading line.
>  
> +@item hs-cycle-filter-function
> +This variable specifies which function should be used in
> +@code{hs-cycle-filter}.

I don't see a need to document this in the user manual, unless you
expect many users to want to customize it.

> +By default this calls to 'hs-cycle', use the new user option

Please remove the "to" part, it's redundant.

> +'hs-cycle-filter-function' to change the function to use.

The default value of hs-cycle-filter-function is _not_ hs-cycle, so I
wonder whether there's a mistake here or what am I missing?

> +(defcustom hs-cycle-filter-function #'hs-toggle-hiding
> +  "Function to use in `hs-cycle-filter'."
> +  :type 'function
> +  :version "31.1")

For a simple customization such as this one, do we really need to go
via a function?  Why not have an additional special value of
hs-cycle-filter to specify that hs-cycle is to be used instead of
hs-toggle-hiding?  This will be much more user-friendly, IMO, and is
what the OP actually requested.  The possibility of specifying a
function can stay, but we don't need to use it to provide this
particular feature.  Or did I miss something?

In any case, the doc string should say something like

  Function intended to be used as the value of `hs-cycle-filter'.

Thanks.




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

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


Received: (at submit) by debbugs.gnu.org; 23 Mar 2026 07:26:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 23 03:26:57 2026
Received: from localhost ([127.0.0.1]:41637 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w4Zgd-0005tw-R6
	for submit <at> debbugs.gnu.org; Mon, 23 Mar 2026 03:26:57 -0400
Received: from lists.gnu.org ([2001:470:142::17]:33250)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mbork@HIDDEN>) id 1w4ZgX-0005sg-Tk
 for submit <at> debbugs.gnu.org; Mon, 23 Mar 2026 03:26:51 -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 <mbork@HIDDEN>) id 1w4ZgS-0006vY-5h
 for bug-gnu-emacs@HIDDEN; Mon, 23 Mar 2026 03:26:44 -0400
Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mbork@HIDDEN>) id 1w4ZgQ-00015m-3F
 for bug-gnu-emacs@HIDDEN; Mon, 23 Mar 2026 03:26:43 -0400
Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
 by mailfhigh.phl.internal (Postfix) with ESMTP id CD7271400043;
 Mon, 23 Mar 2026 03:26:38 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-01.internal (MEProxy); Mon, 23 Mar 2026 03:26:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbork.pl; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1774250798;
 x=1774337198; bh=GJNvhpPO36woIwgUvtYJrYHiv0YFMnWhaFT0O9o5oVg=; b=
 l2MtFEf4GuiXDTLinSQ/CTwNeKTvWNRp8NtLlD5lY9usKscx5yD3ltwyNTHflOjo
 ZcNwX98YPiR06Pvxq1EeEVgC0NAFsgJji7tga4OYD7bf7yWnkrAhr8mLDAVOAhVr
 i6GSPJ85KK/4h2J5q+4XWGM+JsRlFhBXoCb6MAB2Lcq+9DePbmt3L+ROOmj6b3zF
 G8+/lTaOm5l6F0oVj/HfLqBW8ygIYZwBCBNuxDL6SeZxFnLf10MZTJTJPr+71PTD
 EOVbgADo5xZ8FtM9HTPEqNp/ucHSJ1Rpsb49xW+Eh6T5jILht1c5MRfarCdBi8dC
 H1bxqNDLadDR1RaKc74ywQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774250798; x=
 1774337198; bh=GJNvhpPO36woIwgUvtYJrYHiv0YFMnWhaFT0O9o5oVg=; b=2
 fnLQp+7Prs+PNZ35XJgcr2T45G7CT+BCSZsmsLQKx+KtLDCt1RECll8cgjeQ2AxW
 Rmh0avANK7S5H6NEMqX0e5SnbbeVttGQcQWpyIXOYUnDbNUEY4U/hQaNZC5tNbk6
 +yBHo0i9U1mIKBzFmmr5Q+2Ih4/kRWC2+/Opph8ZqrNtitrptB3hHWJ1FKXMVYW+
 ZIw3esF+a+v1IiFtETt/GYNJgjVCu97QEsPkPZSLG1hfvlH/ReyAr58gaFID75/T
 ZNNSVj43iaT7jN3kzHzllzoz7U/lDJ+L/7ELwEWED2QHAMvwpw5nw8TGkiRKbImS
 KGcaNQNnlLlC+yeXvcRSQ==
X-ME-Sender: <xms:LuvAaaSsKse1pUco8RinncgRitGrCkrnNfhHZQU1I-miIEpSFuod2g>
 <xme:LuvAacHGIUWb-6ozSPvl_0C74HVx_fM7jM7fEY49HYD_NaSb_2gVLx4E34gH2H_EF
 Mt8ZF55YBEJ9o_hw2aM0BVB3MkDg2jQeectCL_D494SXi0sGa4KJ24>
X-ME-Received: <xmr:LuvAaakP3m5zi8Oa7ctUnVGdRcMxRoJRDwZOOIynrqf3ModvDaGznQ8VLi1oWAjVpkcys5U3Cqd_S1kn>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefudekuddtucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpehmsghorhhk
 sehmsghorhhkrdhplhenucggtffrrghtthgvrhhnpeekueejteelheeuvdejtefghfevve
 ffvdeljeegveefvdevkeehjedvteduteelvdenucffohhmrghinhepghhnuhdrohhrghdp
 mhgsohhrkhdrphhlnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh
 hfrhhomhepmhgsohhrkhesmhgsohhrkhdrphhlpdhnsggprhgtphhtthhopedvpdhmohgu
 vgepshhmthhpohhuthdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomh
 dprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg
X-ME-Proxy: <xmx:LuvAaX0g_oxBi5-NqrIHOYAkSiACZ8iETy-oJIGPShsZSiz5eU1fTg>
 <xmx:LuvAaWQZ6ebLO7BPDtQlAA9sPPJ5c4fL7LTkmte-FyKtPh02k-M-9w>
 <xmx:LuvAaZvwGQaL79uaqA_qFARa5JQPswwRNLAIIOMy2gdgjQyW4pk5CA>
 <xmx:LuvAabYx4QkWQKwsYdOjFiZwnmgrq6NoM2NHgefZ0RGKBjXneoZKNg>
 <xmx:LuvAaS8sq7fozSMYn-VA96yCx55ftQPpvHj8Ow3aQeCdjcGnR5g3G3j0>
Feedback-ID: i2bc64816:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 23 Mar 2026 03:26:37 -0400 (EDT)
From: mbork@HIDDEN
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: [PATCH 1/2] hideshow: New user option 'hs-cycle-filter-function'
In-Reply-To: <87h5q7bhp1.fsf@HIDDEN>
References: <87h5q7bhp1.fsf@HIDDEN>
User-Agent: mu4e 1.12.15; emacs 31.0.50
Date: Mon, 23 Mar 2026 08:26:32 +0100
Message-ID: <87qzpb2ehj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=103.168.172.153; envelope-from=mbork@HIDDEN;
 helo=fhigh-a2-smtp.messagingengine.com
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_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_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
Cc: bug-gnu-emacs@HIDDEN
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 (/)

On 2026-03-22, at 16:52, Elijah Gabe P=C3=A9rez <eg642616@HIDDEN> wrote:

> Tags: patch
>
> Tags: patch
>
> This patch adds a new option to change the function/command to use in
> `hs-cycle-filter`.
>
> Resquested in:
> https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html
>
> This is only 1 of the 2 requests, the second one is in process.
>
> CC'ing to mbork, who requested it.

Thanks a lot!

One (very minor) question:

--8<---------------cut here---------------start------------->8---
(unless level (setq level 1)) ; For non-interactive calls
--8<---------------cut here---------------end--------------->8---

Is it superior to/more idiomatic than

--8<---------------cut here---------------start------------->8---
(setq level (or level 1))
--8<---------------cut here---------------end--------------->8---

or is it just the question of preference?

Best,

--=20
Marcin Borkowski
https://mbork.pl




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

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


Received: (at submit) by debbugs.gnu.org; 22 Mar 2026 22:52:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 22 18:52:47 2026
Received: from localhost ([127.0.0.1]:34013 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1w4Rf4-0002lw-CB
	for submit <at> debbugs.gnu.org; Sun, 22 Mar 2026 18:52:47 -0400
Received: from lists.gnu.org ([2001:470:142::17]:57274)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1w4Rez-0002kx-V1
 for submit <at> debbugs.gnu.org; Sun, 22 Mar 2026 18:52:44 -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 1w4Reu-00009B-7o
 for bug-gnu-emacs@HIDDEN; Sun, 22 Mar 2026 18:52:36 -0400
Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1w4Res-00053D-BY
 for bug-gnu-emacs@HIDDEN; Sun, 22 Mar 2026 18:52:35 -0400
Received: by mail-ot1-x344.google.com with SMTP id
 46e09a7af769-7d75ed779bfso2791151a34.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 22 Mar 2026 15:52:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1774219952; x=1774824752; darn=gnu.org;
 h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=V+tWvu5ONDRr8nkKeSU7G3mz5OQOuPFk7SaUHKjW/WQ=;
 b=Ke7bwaUXzcCpkLFDHYngnmW1Th36UkUgsgWNeZt4p0ktWDK8xFKxtlEa9xESRjDwYo
 hknZ4Hs3iRgoZ/wCc2VTGmR47qfZas1bnSIqUoNLDIoVmXQ+RfAONjnN4C4ZE+fsjMNX
 gtLn3Bx7jvLCLD6RVtsOiI31k5muucII/XxDOyoRED8nURY7Jva2xirMg9yh8Hz32egH
 Ssb76dZyn2dqik7SlUJt73XkwdpmMOn0TMGR+eCKtWpcOwURbxJSD8T/DvUmT2Zh7GLz
 /BXdZo2fc+4kg+aJnirczQYTNeb1ODNxotJUz9zBtw62aAleL7lOxqh1S7CzwSCM1ozN
 tO2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20251104; t=1774219952; x=1774824752;
 h=mime-version:message-id:date:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=V+tWvu5ONDRr8nkKeSU7G3mz5OQOuPFk7SaUHKjW/WQ=;
 b=juT0DqxYPqkH3FY99cOuyxxqixq5YTh6wBgE4dbx2recbUlVVE7iQ/NooAJZ1pEVoU
 3F8wNAB7dTjMTOqJtMw59DH7+HTn2ShApl1sP54TkusCGtTwIMB5EMgTYMIu35PeU0PP
 p+UNCHazojrlE06g1cZR8B13gZTFTnMnYCdTccsbpfc9BBdP6Y1OGHwr3vRAaim+Yf1u
 bSfIsdgQXKsPo2DsBU636Rt588esnxumH25sjO9XlDrg1V8exP3CHngnPTb2qZZbIyL2
 Zfz8MZzpBGhGJUsuSUiP21dMKBG3VAOkxbNlEFZNtaiPss/KtSatug26WJplLPfv8t/t
 7H/A==
X-Gm-Message-State: AOJu0Yw8uprbUhDokDMahTeOLKCJkC2lXapgjsRvbMri6XHDX2Lx09qP
 Hku8aefoDqEF0H2Q+FK8bbB16UrZxzmLnsLwT74CJ4XUlOBWmwZ256E6lR5DxkH2
X-Gm-Gg: ATEYQzxUk5TWNVHRFg3rdST1mNawfPuo1ocWTZp8a8qFL7Y9kt6GvrJhyGHsZj0YvS+
 9wvHAm0QQO/tVUSIYvP1pkOCHmtHeksMdT4K5MgqaRZHdwEM6/pbPtKPwyY0Y5dzwKD8pV3kehO
 D4/lMXY7K0pnun21zVgVOFvT1e0NrFCWbIdZNZ8mIX6RJyElo3IazVZNvMbPVP+wOr4VHKcP5xc
 sti2LXBoH+bOQBGlnhgjQiMnsTqF0RAQ2pOT105F0lWCzQE33LXeDWMrP0CoGI92FsKBZ4bDept
 0HshDS5fljpZAYLryk7JUtsww1A3o/dUTIYAfdlRZwLHwiOB2E4J1ps3yViIxii2/xDKc188+wS
 RITjtQwoXUDP0WSyUkHEvie3kkV4DkgVnj6zF3iyjkTpxJafPivV3XAKU1/t6bTMXO6gCiL+XT5
 TMGWOmQpFB
X-Received: by 2002:a05:6820:134f:b0:67c:1a96:20f6 with SMTP id
 006d021491bc7-67c22ee4bcamr6527123eaf.22.1774219952437; 
 Sun, 22 Mar 2026 15:52:32 -0700 (PDT)
Received: from gabe ([200.77.20.5]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-67c252acc5fsm5114146eaf.1.2026.03.22.15.52.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Mar 2026 15:52:32 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH 1/2] hideshow: New user option 'hs-cycle-filter-function'
Date: Sun, 22 Mar 2026 16:52:26 -0600
Message-ID: <87h5q7bhp1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::344;
 envelope-from=eg642616@HIDDEN; helo=mail-ot1-x344.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: 2.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 Tags: patch This patch adds a new option to
 change the function/command to use in `hs-cycle-filter`. 
 Content analysis details:   (2.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
 headers
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-Debbugs-Envelope-To: submit
Cc: mbork@HIDDEN
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.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 Tags: patch This patch adds a new option to change
    the function/command to use in `hs-cycle-filter`. 
 
 Content analysis details:   (1.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  1.0 FORGED_GMAIL_RCVD      'From' gmail.com does not match 'Received'
                             headers
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (eg642616[at]gmail.com)
  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
                             in digit (eg642616[at]gmail.com)
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -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 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

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

Tags: patch

Tags: patch

This patch adds a new option to change the function/command to use in
`hs-cycle-filter`.

Resquested in:
https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

This is only 1 of the 2 requests, the second one is in process.

CC'ing to mbork, who requested it.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-hideshow-New-user-option-hs-cycle-filter-function-Bu.patch

From f3e490d1942283a353897970f430d49299cedacb Mon Sep 17 00:00:00 2001
From: Elias Gabriel Perez <eg642616@HIDDEN>
Date: Wed, 11 Mar 2026 20:34:39 -0600
Subject: [PATCH] hideshow: New user option 'hs-cycle-filter-function' (Bug#)

https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00153.html

* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce new option.
* lisp/progmodes/hideshow.el (hs-cycle-filter): Rework.
(hs-cycle-filter-function): New user option.
(hs-minor-mode-map, hs-cycle): Update.
---
 doc/emacs/programs.texi    |  5 +++++
 etc/NEWS                   |  3 +++
 lisp/progmodes/hideshow.el | 28 +++++++++++++++++-----------
 3 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 57d3babef41..45e742c281d 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -1742,6 +1742,7 @@ Hideshow
 @vindex hs-indicator-maximum-buffer-size
 @vindex hs-isearch-open
 @vindex hs-hide-block-behavior
+@vindex hs-cycle-filter-function
 @vindex hs-cycle-filter
   These variables can be used to customize Hideshow mode:
 
@@ -1788,6 +1789,10 @@ Hideshow
 binding.  The value @code{nil} means @key{TAB} cannot cycle the
 visibility of the blocks anywhere on the heading line.
 
+@item hs-cycle-filter-function
+This variable specifies which function should be used in
+@code{hs-cycle-filter}.
+
 @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 c26baa03266..1471818cc2e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1361,6 +1361,9 @@ after cursor position.  By default this is set to 'after-bol'.
 This user option controls the positions on the headline of hideable blocks
 where the 'TAB' key cycles the blocks' visibility.
 
+By default this calls to 'hs-cycle', use the new user option
+'hs-cycle-filter-function' to change the function to use.
+
 ---
 *** The variable 'hs-special-modes-alist' is now obsolete.
 Instead of customizing Hideshow for a mode by setting the elements of
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 3043b04c5ad..94e98634423 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -445,17 +445,16 @@ hs-set-up-overlay
 (defcustom hs-cycle-filter nil
   "Control where typing a \\`TAB' cycles the visibility.
 This option determines on which parts of a line where a block
-begins \\`TAB' will be bound to visibility-cycling commands such
-as `hs-toggle-hiding'.  The value t means you can type \\`TAB'
-anywhere on a headline.  The value nil means \\`TAB' always has its
-usual binding.  The value can also be a function of no arguments,
-then \\`TAB' will invoke the visibility-cycling commands where that
-function returns non-nil.  For example, if the value is `bolp',
-those commands will be invoked at the headline's beginning.
+begins \\`TAB' will be bound to visibility-cycling commands.
+The value t means you can type \\`TAB' anywhere on a headline.  The
+value nil means \\`TAB' always has its usual binding.  The value can
+also be a function of no arguments, then \\`TAB' will invoke the
+visibility-cycling commands where that function returns non-nil.  For
+example, if the value is `bolp', those commands will be invoked at the
+headline's beginning.
 This allows to preserve the usual bindings, as determined by the
 major mode, elsewhere on the headlines.
-Currently it affects only the command `hs-toggle-hiding' by default,
-but it can be easily replaced with the command `hs-cycle'."
+See also `hs-cycle-filter-function' to change the function to use."
   :type `(choice (const :tag "Nowhere" nil)
                  (const :tag "Everywhere on the headline" t)
                  (const :tag "At block beginning"
@@ -469,6 +468,11 @@ hs-cycle-filter
                  (function :tag "Custom filter function"))
   :version "31.1")
 
+(defcustom hs-cycle-filter-function #'hs-toggle-hiding
+  "Function to use in `hs-cycle-filter'."
+  :type 'function
+  :version "31.1")
+
 ;;;; Icons
 
 (define-icon hs-indicator-hide nil
@@ -540,7 +544,7 @@ hs-minor-mode-map
   "TAB" `(menu-item
           "" hs-toggle-hiding
           :filter
-          ,(lambda (cmd)
+          ,(lambda (_cmd)
              (when (and hs-cycle-filter
                         ;; On the headline with hideable blocks
                         (save-excursion
@@ -548,7 +552,8 @@ hs-minor-mode-map
                           (hs-get-first-block-on-line))
                         (or (not (functionp hs-cycle-filter))
                             (funcall hs-cycle-filter)))
-               cmd)))
+               (funcall hs-cycle-filter-function)
+               nil)))
   "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding)
 
 (defvar-keymap hs-indicators-map
@@ -1433,6 +1438,7 @@ hs-cycle
 If LEVEL is specified (interactively, the prefix numeric argument), hide
 only blocks which are that many levels below the level of point."
   (interactive "p")
+  (unless level (setq level 1)) ; For non-interactive calls
   (hs-life-goes-on
    (when-let* ((ret (hs-get-near-block :include-comments)))
      (cond ((eq ret 'comment)
-- 
2.51.0


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


-- 
- E.G via GNU Emacs (sent via GNUS).

--=-=-=--




Acknowledgement sent to Elijah Gabe Pérez <eg642616@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#80657; 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: Sun, 12 Apr 2026 18:00:02 UTC

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