mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-14 16:02:12 +00:00
Remove mention of treesit-defun-prefer-top-level (bug#74474)
treesit-defun-prefer-top-level is removed before Emacs 29 released and was replaced by treesit-defun-tactic. These statements that set it doesn't do anything other than introduce confusion, so we should remove them. * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): * lisp/progmodes/js.el (js-ts-mode): * lisp/progmodes/php-ts-mode.el (php-ts-mode): * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): * lisp/progmodes/typescript-ts-mode.el: (typescript-ts-base-mode): Remove statements setting treesit-defun-prefer-top-level.
This commit is contained in:
parent
03ae07291e
commit
50b91ed458
5 changed files with 3 additions and 12 deletions
|
@ -1254,9 +1254,6 @@ BEG and END are described in `treesit-range-rules'."
|
||||||
`((c ,@c-ts-mode--thing-settings)
|
`((c ,@c-ts-mode--thing-settings)
|
||||||
(cpp ,@c-ts-mode--thing-settings)))
|
(cpp ,@c-ts-mode--thing-settings)))
|
||||||
|
|
||||||
;; Nodes like struct/enum/union_specifier can appear in
|
|
||||||
;; function_definitions, so we need to find the top-level node.
|
|
||||||
(setq-local treesit-defun-prefer-top-level t)
|
|
||||||
|
|
||||||
;; When the code is in incomplete state, try to make a better guess
|
;; When the code is in incomplete state, try to make a better guess
|
||||||
;; about which node to indent against.
|
;; about which node to indent against.
|
||||||
|
@ -1346,6 +1343,9 @@ in your init files."
|
||||||
;; Font-lock.
|
;; Font-lock.
|
||||||
(setq-local treesit-font-lock-settings (c-ts-mode--font-lock-settings 'c))
|
(setq-local treesit-font-lock-settings (c-ts-mode--font-lock-settings 'c))
|
||||||
;; Navigation.
|
;; Navigation.
|
||||||
|
;;
|
||||||
|
;; Nodes like struct/enum/union_specifier can appear in
|
||||||
|
;; function_definitions, so we need to find the top-level node.
|
||||||
(setq-local treesit-defun-tactic 'top-level)
|
(setq-local treesit-defun-tactic 'top-level)
|
||||||
(treesit-major-mode-setup)
|
(treesit-major-mode-setup)
|
||||||
|
|
||||||
|
|
|
@ -3916,7 +3916,6 @@ See `treesit-thing-settings' for more information.")
|
||||||
;; Indent.
|
;; Indent.
|
||||||
(setq-local treesit-simple-indent-rules js--treesit-indent-rules)
|
(setq-local treesit-simple-indent-rules js--treesit-indent-rules)
|
||||||
;; Navigation.
|
;; Navigation.
|
||||||
(setq-local treesit-defun-prefer-top-level t)
|
|
||||||
(setq-local treesit-defun-type-regexp
|
(setq-local treesit-defun-type-regexp
|
||||||
(rx (or "class_declaration"
|
(rx (or "class_declaration"
|
||||||
"method_definition"
|
"method_definition"
|
||||||
|
|
|
@ -1479,10 +1479,6 @@ Depends on `c-ts-common-comment-setup'."
|
||||||
"statement")))
|
"statement")))
|
||||||
(text ,(regexp-opt '("comment" "text"))))))
|
(text ,(regexp-opt '("comment" "text"))))))
|
||||||
|
|
||||||
;; Nodes like struct/enum/union_specifier can appear in
|
|
||||||
;; function_definitions, so we need to find the top-level node.
|
|
||||||
(setq-local treesit-defun-prefer-top-level t)
|
|
||||||
|
|
||||||
;; Indent.
|
;; Indent.
|
||||||
(when (eq php-ts-mode-indent-style 'wordpress)
|
(when (eq php-ts-mode-indent-style 'wordpress)
|
||||||
(setq-local indent-tabs-mode t))
|
(setq-local indent-tabs-mode t))
|
||||||
|
|
|
@ -1198,9 +1198,6 @@ leading double colon is not added."
|
||||||
(treesit-node-parent node))
|
(treesit-node-parent node))
|
||||||
"interpolation"))))))))
|
"interpolation"))))))))
|
||||||
|
|
||||||
;; AFAIK, Ruby can not nest methods
|
|
||||||
(setq-local treesit-defun-prefer-top-level nil)
|
|
||||||
|
|
||||||
;; Imenu.
|
;; Imenu.
|
||||||
(setq-local imenu-create-index-function #'ruby-ts--imenu)
|
(setq-local imenu-create-index-function #'ruby-ts--imenu)
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,6 @@ This mode is intended to be inherited by concrete major modes."
|
||||||
|
|
||||||
;; Comments.
|
;; Comments.
|
||||||
(c-ts-common-comment-setup)
|
(c-ts-common-comment-setup)
|
||||||
(setq-local treesit-defun-prefer-top-level t)
|
|
||||||
|
|
||||||
;; Electric
|
;; Electric
|
||||||
(setq-local electric-indent-chars
|
(setq-local electric-indent-chars
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue