From 6010b40247b8cb4b8a127a34361b99562ea81db9 Mon Sep 17 00:00:00 2001 From: Prashant Vithani Date: Mon, 30 Jun 2025 17:05:18 +0000 Subject: [PATCH] fix(fold): Use function variables over direct func Replace direct calls to `hs-looking-at-block-start-p` and `hs-find-block-beginning` with their corresponding function variables to ensure compatibility with hideshow mode's configurable function handling. These function variables are set in [`treesit` in Emacs 31][1]. It broke fold because `hs-block-start-regexp` is set to `nil` explicitly by treesit overrides. The default for `hs-looking-at-block-start-p-func` and `hs-find-block-beginning-func` are same as what was being called before. Ref: [1]: https://github.com/emacs-mirror/emacs/commits/2e3b085d447bc2cd1a0e779145be9cab9a15d7af --- modules/editor/fold/autoload/fold.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/editor/fold/autoload/fold.el b/modules/editor/fold/autoload/fold.el index 57f2fdf88..de31a5711 100644 --- a/modules/editor/fold/autoload/fold.el +++ b/modules/editor/fold/autoload/fold.el @@ -35,8 +35,8 @@ Return non-nil if successful in doing so." (when (+fold--ensure-hideshow-mode) (save-excursion (ignore-errors - (or (hs-looking-at-block-start-p) - (hs-find-block-beginning) + (or (funcall hs-looking-at-block-start-p-func) + (funcall hs-find-block-beginning-func) (unless (eolp) (end-of-line) (+fold--hideshow-fold-p)))))))