all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 62717@debbugs.gnu.org
Subject: bug#62717: 29.0.60; c-ts-mode does not indent the first line in a function after RET
Date: Fri, 07 Apr 2023 21:48:48 +0200	[thread overview]
Message-ID: <m1355ba2xr.fsf@yahoo.es> (raw)
In-Reply-To: m1355ba2xr.fsf.ref@yahoo.es


emacs -Q
C-x b sample.c RET
M-x c-ts-mode RET

int main() {

If I press RET at the end of the line, the point is not indented.

The Tree-sitter tree for the code is

(translation_unit
 (function_definition type: (primitive_type)
  declarator: 
   (function_declarator declarator: (identifier)
    parameters: (parameter_list ( )))
  body: (compound_statement { })))

If I insert a closing bracket, that is:

int main() {
}

The newline indents correctly.  The Tree-sitter tree is now

(function_definition type: (primitive_type)
 declarator: 
  (function_declarator declarator: (identifier)
   parameters: (parameter_list ( )))
 body: (compound_statement { }))

It seems that Tree-sitter parses both code snippets without errors and
Emacs should automatically indent after RET in the first case.





       reply	other threads:[~2023-04-07 19:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1355ba2xr.fsf.ref@yahoo.es>
2023-04-07 19:48 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-04-08  1:57   ` bug#62717: 29.0.60; c-ts-mode does not indent the first line in a function after RET Dmitry Gutov
2023-04-08 18:37     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09  0:20       ` Dmitry Gutov
2023-04-09  5:19         ` Eli Zaretskii
2023-04-09 16:33           ` Dmitry Gutov
2023-04-09 17:37             ` Eli Zaretskii
2023-04-10  0:36               ` Dmitry Gutov
2023-04-10 21:04                 ` Yuan Fu
2023-04-09 11:05         ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-09 16:30           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1355ba2xr.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62717@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.