From b18754bb179a1125a7de99f7e2351776669d3cfc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 15 Feb 2023 20:01:40 +0200 Subject: [PATCH] Minor improvements in c-ts-mode and docs * lisp/progmodes/c-ts-mode.el (c-ts-base-mode-map): Add a binding for comment-region. * doc/emacs/programs.texi (C Indent): Mention "C-u TAB". --- doc/emacs/programs.texi | 13 ++++++++----- lisp/progmodes/c-ts-mode.el | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index e9268ff2a0d..69b4f56bee1 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -540,15 +540,18 @@ declaration (@code{c-indent-defun} in CC mode, @kindex C-M-q @r{(C mode)} @findex c-indent-exp @findex prog-indent-sexp -Reindent each line in the balanced expression that follows point. In -CC mode, this invokes @code{c-indent-exp}; in tree-sitter based -@code{c-ts-mode} this invokes a more general @code{prog-indent-sexp}. -A prefix argument inhibits warning messages about invalid syntax. +Reindent each line in the balanced expression (@pxref{Expressions}), +also known as ``sexp'', that follows point. In CC mode, this invokes +@code{c-indent-exp}; in tree-sitter based @code{c-ts-mode} this +invokes a more general @code{prog-indent-sexp}. A prefix argument +inhibits warning messages about invalid syntax. @item @key{TAB} @findex c-indent-line-or-region Reindent the current line, active region, or block starting on this -line (@code{c-indent-line-or-region}). +line (@code{c-indent-line-or-region}). With prefix argument, rigidly +reindent the balanced expression which starts on the current line, if +the current line needs reindentation. @vindex c-tab-always-indent If @code{c-tab-always-indent} is @code{t}, this command always reindents diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 04f68881945..5337d148fc0 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -738,7 +738,8 @@ the semicolon. This function skips the semicolon." :doc "Keymap for C and C-like languages with tree-sitter" :parent prog-mode-map "C-c C-q" #'c-ts-mode-indent-defun - "C-c ." #'c-ts-mode-set-style) + "C-c ." #'c-ts-mode-set-style + "C-c C-c" #'comment-region) ;;;###autoload (define-derived-mode c-ts-base-mode prog-mode "C" -- 2.39.2