From: Eli Zaretskii Date: Wed, 15 Feb 2023 18:01:40 +0000 (+0200) Subject: Minor improvements in c-ts-mode and docs X-Git-Tag: emacs-29.0.90~426^2~9 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b18754bb179;p=emacs.git 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". --- 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"