From e881a172d483551ab546a4586beaa3d54ee0e148 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 27 Sep 2023 17:17:48 -0700 Subject: [PATCH] ; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. --- lisp/treesit.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 0790ad7e011..fd8c8482fc8 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1880,10 +1880,10 @@ Helper function to use in the `interactive' spec of `treesit-check-indent'." (format-prompt "Target major mode" default) obarray (lambda (sym) - (and (string-match-p "-mode\\'" (symbol-name sym)) + (and (string-suffix-p "-mode" (symbol-name sym)) (not (or (memq sym minor-mode-list) - (string-match-p "-minor-mode\\'" - (symbol-name sym)))))) + (string-suffix-p "-minor-mode" + (symbol-name sym)))))) nil nil nil default nil))) (cond ((equal mode "nil") nil)