From ef2584585b095fff1e045e58673d2a7c8f9af799 Mon Sep 17 00:00:00 2001 From: Elías Gabriel Pérez Date: Sat, 8 Nov 2025 20:04:30 +0200 Subject: hideshow: Rework previous changes * lisp/progmodes/hideshow.el: Set default values of buffer-local variables. (hs-inside-comment-p): Restore. (hs--set-variable): Rename from 'hs--get-mode-value'. (hs-grok-mode-type): Rework. * lisp/nxml/nxml-mode.el: * lisp/progmodes/f90.el: * lisp/progmodes/fortran.el: * lisp/progmodes/icon.el: * lisp/progmodes/lua-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/verilog-mode.el: * lisp/progmodes/vhdl-mode.el: * lisp/textmodes/mhtml-mode.el: * lisp/textmodes/sgml-mode.el: * lisp/treesit.el (treesit-major-mode-setup): Rename 'hs-forward-sexp-func' to 'hs-forward-sexp-function', 'hs-adjust-block-beginning' to 'hs-adjust-block-beginning-function', 'hs-find-block-beginning-func' to 'hs-find-block-beginning-function', 'hs-find-next-block-func' to 'hs-find-next-block-function', 'hs-looking-at-block-start-p-func' to 'hs-looking-at-block-start-predicate', 'hs-inside-comment-p-func' to 'hs-inside-comment-predicate'. --- lisp/progmodes/python.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f34fb28826f..12557aecf4d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5913,7 +5913,7 @@ are also searched. REGEXP is passed to `looking-at' to set (looking-at regexp))))) (defun python-ts-hs-adjust-block-end-fn (block-beg) - "Python-ts-mode specific `hs-adjust-block-end' function for `hs-minor-mode'. + "Python-ts-mode specific `hs-adjust-block-end-function' function. BLOCK-BEG is the beginning position where the hiding will be performed. @@ -7360,10 +7360,10 @@ implementations: `python-mode' and `python-ts-mode'." ;; "\\s)". This way parens at end of defun are properly hidden. (setq-local hs-block-end-regexp "") (setq-local hs-c-start-regexp "#") - (setq-local hs-forward-sexp-func #'python-hideshow-forward-sexp-function) - (setq-local hs-find-block-beginning-func #'python-nav-beginning-of-block) - (setq-local hs-find-next-block-func #'python-hideshow-find-next-block) - (setq-local hs-looking-at-block-start-p-func #'python-info-looking-at-beginning-of-block) + (setq-local hs-forward-sexp-function #'python-hideshow-forward-sexp-function) + (setq-local hs-find-block-beginning-function #'python-nav-beginning-of-block) + (setq-local hs-find-next-block-function #'python-hideshow-find-next-block) + (setq-local hs-looking-at-block-start-predicate #'python-info-looking-at-beginning-of-block) (setq-local outline-regexp (python-rx (* space) block-start)) (setq-local outline-level @@ -7438,7 +7438,7 @@ implementations: `python-mode' and `python-ts-mode'." treesit-sexp-thing 'sexp) (setq-local hs-treesit-things '(or defun sexp)) - (setq-local hs-adjust-block-end #'python-ts-hs-adjust-block-end-fn) + (setq-local hs-adjust-block-end-function #'python-ts-hs-adjust-block-end-fn) (setq-local syntax-propertize-function #'python--treesit-syntax-propertize) -- cgit v1.2.1