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".
This commit is contained in:
Eli Zaretskii 2023-02-15 20:01:40 +02:00
parent 3c6b726a7b
commit b18754bb17
2 changed files with 10 additions and 6 deletions

View file

@ -540,15 +540,18 @@ declaration (@code{c-indent-defun} in CC mode,
@kindex C-M-q @r{(C mode)} @kindex C-M-q @r{(C mode)}
@findex c-indent-exp @findex c-indent-exp
@findex prog-indent-sexp @findex prog-indent-sexp
Reindent each line in the balanced expression that follows point. In Reindent each line in the balanced expression (@pxref{Expressions}),
CC mode, this invokes @code{c-indent-exp}; in tree-sitter based also known as ``sexp'', that follows point. In CC mode, this invokes
@code{c-ts-mode} this invokes a more general @code{prog-indent-sexp}. @code{c-indent-exp}; in tree-sitter based @code{c-ts-mode} this
A prefix argument inhibits warning messages about invalid syntax. invokes a more general @code{prog-indent-sexp}. A prefix argument
inhibits warning messages about invalid syntax.
@item @key{TAB} @item @key{TAB}
@findex c-indent-line-or-region @findex c-indent-line-or-region
Reindent the current line, active region, or block starting on this 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 @vindex c-tab-always-indent
If @code{c-tab-always-indent} is @code{t}, this command always reindents If @code{c-tab-always-indent} is @code{t}, this command always reindents

View file

@ -738,7 +738,8 @@ the semicolon. This function skips the semicolon."
:doc "Keymap for C and C-like languages with tree-sitter" :doc "Keymap for C and C-like languages with tree-sitter"
:parent prog-mode-map :parent prog-mode-map
"C-c C-q" #'c-ts-mode-indent-defun "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 ;;;###autoload
(define-derived-mode c-ts-base-mode prog-mode "C" (define-derived-mode c-ts-base-mode prog-mode "C"