From: Yuan Fu Date: Wed, 12 Feb 2025 04:38:00 +0000 (-0800) Subject: Use c-ts-common's comment setup in go-ts-mode (bug#75978) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c6d319feaf3a122a812bcadd150d714115c1e314;p=emacs.git 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. (cherry picked from commit 19314257485e88a82b128fe39c60ffd08862da58) --- diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 469df9904c4..0d1265309e8 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -42,6 +42,7 @@ ;;; Code: (require 'treesit) +(require 'c-ts-common) (eval-when-compile (require 'rx)) (treesit-declare-unavailable-functions) @@ -279,9 +280,7 @@ (setq treesit-primary-parser (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 @@ -564,9 +563,7 @@ what the parent of the node would be if it were a node." (setq treesit-primary-parser (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