[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)
- emacs-29 updated (2608e5edcc -> d90d7d15f2), Yuan Fu, 2022/12/26
- emacs-29 2bcd1e9a99 3/9: ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice., Yuan Fu, 2022/12/26
- emacs-29 7c7950fe00 2/9: Add maintainer stub for tree-sitter files, Yuan Fu, 2022/12/26
- emacs-29 c6b0282645 5/9: ; Remove unused function in c-ts-mode,
Yuan Fu <=
- emacs-29 6e52a9fcad 4/9: ; * doc/lispref/modes.texi (Parser-based Font Lock): Minor fixes., Yuan Fu, 2022/12/26
- emacs-29 8f68b6497e 7/9: Clean up python-ts-mode font-lock features, Yuan Fu, 2022/12/26
- emacs-29 eb26872837 8/9: Fix imenu for c-ts-mode (bug#60296), Yuan Fu, 2022/12/26
- emacs-29 d90d7d15f2 9/9: ; Fix vindexes in parsing.texi, Yuan Fu, 2022/12/26
- emacs-29 cf32776622 1/9: ; * doc/lispref/parsing.texi (Using Parser): Remove deleted function., Yuan Fu, 2022/12/26
- emacs-29 28f26b11a1 6/9: Add comment indent and filling to other tree-sitter major modes, Yuan Fu, 2022/12/26