From: Yuan Fu Date: Thu, 28 Sep 2023 00:17:48 +0000 (-0700) Subject: ; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e881a172d483551ab546a4586beaa3d54ee0e148;p=emacs.git ; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. --- 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)