]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p.
authorYuan Fu <casouri@gmail.com>
Thu, 28 Sep 2023 00:17:48 +0000 (17:17 -0700)
committerYuan Fu <casouri@gmail.com>
Thu, 28 Sep 2023 04:52:59 +0000 (21:52 -0700)
lisp/treesit.el

index 0790ad7e011b9e251fbfeba9b3930c3eb47aa6cc..fd8c8482fc8a3bb2e5b1080cadaeac9fa0b2ae7b 100644 (file)
@@ -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)