1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00

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.
This commit is contained in:
Elías Gabriel Pérez 2025-10-25 10:46:56 -06:00 committed by Juri Linkov
parent 2c41bfabbc
commit cc589d7003
18 changed files with 228 additions and 243 deletions

View file

@ -549,7 +549,7 @@ than ENDDO.")
"\\|!\\|$\\)")
"Regexp matching the end of a Fortran \"block\", from the line start.
Note that only ENDDO is handled for the end of a DO-loop. Used
in the Fortran entry in `hs-modes-alist'.")
in the Fortran entry in `hs-block-end-regexp'.")
(defconst fortran-start-block-re
(concat
@ -582,11 +582,7 @@ in the Fortran entry in `hs-modes-alist'.")
"Regexp matching the start of a Fortran \"block\", from the line start.
A simple regexp cannot do this in fully correct fashion, so this
tries to strike a compromise between complexity and flexibility.
Used in the Fortran entry in `hs-modes-alist'.")
(add-to-list 'hs-modes-alist
`(fortran-mode (start . ,fortran-start-block-re) (end . ,fortran-end-block-re)
(c-start . "^[cC*!]") (forward-fn . fortran-end-of-block)))
Used in the Fortran entry in `hs-block-start-regexp'.")
(defvar fortran-mode-syntax-table
@ -837,7 +833,11 @@ with no args, if that value is non-nil."
#'fortran-current-defun)
(setq-local dabbrev-case-fold-search 'case-fold-search)
(setq-local gud-find-expr-function 'fortran-gud-find-expr)
(add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t))
(add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
(setq-local hs-block-start-regexp fortran-start-block-re)
(setq-local hs-block-end-regexp fortran-end-block-re)
(setq-local hs-c-start-regexp "^[cC*!]")
(setq-local hs-forward-sexp-func #' fortran-end-of-block))
(defun fortran-line-length (nchars &optional global)
@ -1247,7 +1247,7 @@ Directive lines are treated as comments."
(goto-char i)
(= (line-beginning-position) p)))))
;; Used in hs-modes-alist.
;; Used in hs-forward-sexp-func.
(defun fortran-end-of-block (&optional num)
"Move point forward to the end of the current code block.
With optional argument NUM, go forward that many balanced blocks.