emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs


From: Eli Zaretskii
Subject: emacs-29 b18754bb179: Minor improvements in c-ts-mode and docs
Date: Wed, 15 Feb 2023 13:02:29 -0500 (EST)

branch: emacs-29
commit b18754bb179a1125a7de99f7e2351776669d3cfc
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]