[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 839341d7370 5/7: Make more granular defun-type-regexp (bug#5987
From: |
Yuan Fu |
Subject: |
emacs-29 839341d7370 5/7: Make more granular defun-type-regexp (bug#59873) |
Date: |
Fri, 9 Dec 2022 19:46:44 -0500 (EST) |
branch: emacs-29
commit 839341d73707be2082abbd8834ba46292e59aeb7
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Yuan Fu <casouri@gmail.com>
Make more granular defun-type-regexp (bug#59873)
We don't want to match local_variable_declaration and others to hit on
beginning-of-defun. The fix is just to make the regexp a bit more
granular.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Use regexp-opt to
distinguish more granularly.
---
lisp/progmodes/java-ts-mode.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index 23e166ee4c3..9155a7fff25 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -321,7 +321,15 @@ the subtrees."
(append "{}():;," electric-indent-chars))
;; Navigation.
- (setq-local treesit-defun-type-regexp "declaration")
+ (setq-local treesit-defun-type-regexp
+ (regexp-opt '("method_declaration"
+ "class_declaration"
+ "record_declaration"
+ "interface_declaration"
+ "enum_declaration"
+ "import_declaration"
+ "package_declaration"
+ "module_declaration")))
;; Font-lock.
(setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings)
- emacs-29 updated (33a8415eb7e -> 8f53fa10d94), Yuan Fu, 2022/12/09
- emacs-29 4df35e3491c 1/7: Improve fontification in csharp-ts-mode (bug#59909), Yuan Fu, 2022/12/09
- emacs-29 839341d7370 5/7: Make more granular defun-type-regexp (bug#59873),
Yuan Fu <=
- emacs-29 1014bcc8e32 3/7: Fix fontification of method-invocations in js-ts-mode (bug#59904), Yuan Fu, 2022/12/09
- emacs-29 7141920c6af 2/7: Fix escape-sequence feature in typescript-ts-mode (bug#59906), Yuan Fu, 2022/12/09
- emacs-29 8de8f1dc051 6/7: Add class_body indentation for typescript (bug#59680), Yuan Fu, 2022/12/09
- emacs-29 8f53fa10d94 7/7: Fontify "this" as a keyword in c++-ts-mode (bug#59924), Yuan Fu, 2022/12/09
- emacs-29 8f49137c9bf 4/7: Add dockerfile-ts-mode (Bug#59894), Yuan Fu, 2022/12/09