From 19314257485e88a82b128fe39c60ffd08862da58 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 11 Feb 2025 20:38:00 -0800 Subject: [PATCH] Use c-ts-common's comment setup in go-ts-mode (bug#75978) c-ts-common-comment-setup sets up fill-paragraph-function, which enables filling for comments. * lisp/progmodes/go-ts-mode.el (go-ts-mode): (go-mod-ts-mode): Use c-ts-common-comment-setup. --- lisp/progmodes/go-ts-mode.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index cdd6e427db7..5110ab890f3 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -28,6 +28,7 @@ ;;; Code: (require 'treesit) +(require 'c-ts-common) (eval-when-compile (require 'rx)) (declare-function treesit-parser-create "treesit.c") @@ -258,9 +259,7 @@ (treesit-parser-create 'go) ;; Comments. - (setq-local comment-start "// ") - (setq-local comment-end "") - (setq-local comment-start-skip (rx "//" (* (syntax whitespace)))) + (c-ts-common-comment-setup) ;; Navigation. (setq-local treesit-defun-type-regexp @@ -458,9 +457,7 @@ what the parent of the node would be if it were a node." (treesit-parser-create 'gomod) ;; Comments. - (setq-local comment-start "// ") - (setq-local comment-end "") - (setq-local comment-start-skip (rx "//" (* (syntax whitespace)))) + (c-ts-common-comment-setup) ;; Indent. (setq-local indent-tabs-mode t