commit cc589d70039af48332699428cbce352fe890eb2c (HEAD, refs/remotes/origin/master) Author: Elías Gabriel Pérez Date: Sat Oct 25 10:46:56 2025 -0600 hideshow: Rework previous changes * doc/emacs/programs.texi (Hideshow): * etc/NEWS: Fix doc. * lisp/progmodes/hideshow.el: Update Commentary Header. (hs-modes-alist): Remove. (hs--get-mode-value, hs-grok-mode-type): Rework. * lisp/treesit.el (treesit-major-mode-setup): * lisp/emacs-lisp/lisp-mode.el: * lisp/nxml/nxml-mode.el: * lisp/progmodes/cc-mode.el: * lisp/progmodes/f90.el: * lisp/progmodes/fortran.el: * lisp/progmodes/hideshow.el: * lisp/progmodes/icon.el: * lisp/progmodes/js.el: * lisp/progmodes/lua-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/verilog-mode.el: * lisp/progmodes/vhdl-mode.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/mhtml-mode.el: * lisp/textmodes/sgml-mode.el: * lisp/treesit.el: Fix and rework previous changes. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 12bde32be05..f08a3834c17 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1688,8 +1688,9 @@ row). Just what constitutes a block depends on the major mode. In C mode and related modes, blocks are delimited by braces, while in Lisp mode they are delimited by parentheses. Multi-line comments also count as blocks. +@vindex hs-prefix-map - Hideshow mode provides the following commands: + Hideshow mode provides the following commands (defined in @code{hs-prefix-map}): @findex hs-hide-all @findex hs-hide-block @@ -1735,7 +1736,6 @@ Hide all blocks @var{n} levels below this block @vindex hs-indicator-maximum-buffer-size @vindex hs-isearch-open @vindex hs-hide-block-behavior -@vindex hs-modes-alist These variables can be used to customize Hideshow mode: @table @code @@ -1782,9 +1782,6 @@ code blocks and comments), or @code{nil} (unhide neither code blocks nor comments). The default value is @code{code}. @end table -All necessary settings for each mode can be found in the variable -@code{hs-modes-alist}. - @node Symbol Completion @section Completion for Symbol Names @cindex completion (symbol names) diff --git a/etc/NEWS b/etc/NEWS index ed504118e66..0dbe168d8c1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1108,9 +1108,6 @@ after cursor position. By default this is set to 'after-bol'. +++ *** The variable 'hs-special-modes-alist' is now obsolete. -Use the new variable 'hs-modes-alist' instead, which supports mode -hierarchy for each value. - ** C-ts mode diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index e4dfc7c2f78..0756c0f908f 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -729,7 +729,9 @@ font-lock keywords will not be case sensitive." :group 'lisp (lisp-mode-variables nil t nil) (setq-local electric-quote-string t) - (setq imenu-case-fold-search nil)) + (setq imenu-case-fold-search nil) + (setq-local hs-block-start-regexp "\\s(\\|\"") + (setq-local hs-block-end-regexp "\\s)\\|\"")) (defun lisp-outline-level () "Lisp mode `outline-level' function." diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index ae27824fdc9..08c6c1b2fac 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -532,6 +532,10 @@ Many aspects this mode can be customized using (setq-local comment-line-break-function #'nxml-newline-and-indent) (setq-local comment-quote-nested-function #'nxml-comment-quote-nested) (setq-local comment-continue "") ; avoid double-hyphens as a padding + (setq-local hs-block-start-regexp "<[^/>]*?") + (setq-local hs-block-end-regexp "]*[^/]>") + (setq-local hs-c-start-regexp "