emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 c6b0282645 5/9: ; Remove unused function in c-ts-mode


From: Yuan Fu
Subject: emacs-29 c6b0282645 5/9: ; Remove unused function in c-ts-mode
Date: Mon, 26 Dec 2022 04:48:08 -0500 (EST)

branch: emacs-29
commit c6b02826450e3d40b4a2ea4e6026a813d3679d8d
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Remove unused function in c-ts-mode
    
    * 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 | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 1d211da176..8569f3107b 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]