]> git.eshelyaron.com Git - emacs.git/commitdiff
; Remove unused function in c-ts-mode
authorYuan Fu <casouri@gmail.com>
Sun, 25 Dec 2022 19:11:00 +0000 (11:11 -0800)
committerYuan Fu <casouri@gmail.com>
Mon, 26 Dec 2022 09:47:55 +0000 (01:47 -0800)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--end-of-defun): Remove.
(c-ts-mode)
(c++-ts-mode): Remove setup.

lisp/progmodes/c-ts-mode.el

index 1d211da176593aa8984d108b76e6053dbd8ea66d..8569f3107b7345bbc0ca9519dd2b0fbdd4595745 100644 (file)
@@ -549,19 +549,6 @@ the subtrees."
 
 ;;; Defun navigation
 
-(defun c-ts-mode--end-of-defun ()
-  "`end-of-defun-function' of `c-ts-mode'."
-  ;; A struct/enum/union_specifier node doesn't include the ; at the
-  ;; end, so we manually skip it.
-  (treesit-end-of-defun)
-  (when (looking-at (rx (* " ") ";"))
-    (goto-char (match-end 0))
-    ;; This part is copied from `end-of-defun'.
-    (unless (bolp)
-      (skip-chars-forward " \t")
-      (if (looking-at "\\s<\\|\n")
-         (forward-line 1)))))
-
 (defun c-ts-mode--defun-valid-p (node)
   (if (string-match-p
        (rx (or "struct_specifier"
@@ -766,11 +753,7 @@ ARG is passed to `fill-paragraph'."
   ;; Font-lock.
   (setq-local treesit-font-lock-settings (c-ts-mode--font-lock-settings 'c))
 
-  (treesit-major-mode-setup)
-
-  ;; Override default value of end-of-defun-function set by
-  ;; `treesit-major-mode-setup'.
-  (setq-local end-of-defun-function #'c-ts-mode--end-of-defun))
+  (treesit-major-mode-setup))
 
 ;;;###autoload
 (define-derived-mode c++-ts-mode c-ts-base-mode "C++"
@@ -800,11 +783,7 @@ ARG is passed to `fill-paragraph'."
   ;; Font-lock.
   (setq-local treesit-font-lock-settings (c-ts-mode--font-lock-settings 'cpp))
 
-  (treesit-major-mode-setup)
-
-  ;; Override default value of end-of-defun-function set by
-  ;; `treesit-major-mode-setup'.
-  (setq-local end-of-defun-function #'c-ts-mode--end-of-defun))
+  (treesit-major-mode-setup))
 
 (provide 'c-ts-mode)