aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorElías Gabriel Pérez2025-11-08 20:04:30 +0200
committerJuri Linkov2025-11-08 20:04:30 +0200
commitef2584585b095fff1e045e58673d2a7c8f9af799 (patch)
treefbbf0d28b31700c50b624ddc87bbd06d22e02465 /lisp/progmodes/python.el
parent5d11ee9f54a2795f648d6daa5321866dfec37bac (diff)
downloademacs-ef2584585b095fff1e045e58673d2a7c8f9af799.tar.gz
emacs-ef2584585b095fff1e045e58673d2a7c8f9af799.zip
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'.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el12
1 files changed, 6 insertions, 6 deletions
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
5913 (looking-at regexp))))) 5913 (looking-at regexp)))))
5914 5914
5915(defun python-ts-hs-adjust-block-end-fn (block-beg) 5915(defun python-ts-hs-adjust-block-end-fn (block-beg)
5916 "Python-ts-mode specific `hs-adjust-block-end' function for `hs-minor-mode'. 5916 "Python-ts-mode specific `hs-adjust-block-end-function' function.
5917 5917
5918BLOCK-BEG is the beginning position where the hiding will be performed. 5918BLOCK-BEG is the beginning position where the hiding will be performed.
5919 5919
@@ -7360,10 +7360,10 @@ implementations: `python-mode' and `python-ts-mode'."
7360 ;; "\\s)". This way parens at end of defun are properly hidden. 7360 ;; "\\s)". This way parens at end of defun are properly hidden.
7361 (setq-local hs-block-end-regexp "") 7361 (setq-local hs-block-end-regexp "")
7362 (setq-local hs-c-start-regexp "#") 7362 (setq-local hs-c-start-regexp "#")
7363 (setq-local hs-forward-sexp-func #'python-hideshow-forward-sexp-function) 7363 (setq-local hs-forward-sexp-function #'python-hideshow-forward-sexp-function)
7364 (setq-local hs-find-block-beginning-func #'python-nav-beginning-of-block) 7364 (setq-local hs-find-block-beginning-function #'python-nav-beginning-of-block)
7365 (setq-local hs-find-next-block-func #'python-hideshow-find-next-block) 7365 (setq-local hs-find-next-block-function #'python-hideshow-find-next-block)
7366 (setq-local hs-looking-at-block-start-p-func #'python-info-looking-at-beginning-of-block) 7366 (setq-local hs-looking-at-block-start-predicate #'python-info-looking-at-beginning-of-block)
7367 7367
7368 (setq-local outline-regexp (python-rx (* space) block-start)) 7368 (setq-local outline-regexp (python-rx (* space) block-start))
7369 (setq-local outline-level 7369 (setq-local outline-level
@@ -7438,7 +7438,7 @@ implementations: `python-mode' and `python-ts-mode'."
7438 treesit-sexp-thing 'sexp) 7438 treesit-sexp-thing 'sexp)
7439 7439
7440 (setq-local hs-treesit-things '(or defun sexp)) 7440 (setq-local hs-treesit-things '(or defun sexp))
7441 (setq-local hs-adjust-block-end #'python-ts-hs-adjust-block-end-fn) 7441 (setq-local hs-adjust-block-end-function #'python-ts-hs-adjust-block-end-fn)
7442 7442
7443 (setq-local syntax-propertize-function #'python--treesit-syntax-propertize) 7443 (setq-local syntax-propertize-function #'python--treesit-syntax-propertize)
7444 7444