GNU bug report logs - #61502
29.0.60; c-ts-mode auto-indent not working

Previous Next

Package: emacs;

Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>

Date: Tue, 14 Feb 2023 04:37:01 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 61502 <at> debbugs.gnu.org, casouri <at> gmail.com, theo <at> thornhill.no, pankaj <at> codeisgreat.org
Subject: bug#61502: 29.0.60; c-ts-mode auto-indent not working
Date: Wed, 15 Feb 2023 20:11:43 +0200
> Date: Wed, 15 Feb 2023 19:57:04 +0200
> Cc: 61502 <at> debbugs.gnu.org, casouri <at> gmail.com, theo <at> thornhill.no,
>  pankaj <at> codeisgreat.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> 
> On 15/02/2023 19:11, Eli Zaretskii wrote:
> >> Date: Wed, 15 Feb 2023 17:57:51 +0200
> >> Cc:61502 <at> debbugs.gnu.org,casouri <at> gmail.com,pankaj <at> codeisgreat.org
> >> From: Dmitry Gutov<dgutov <at> yandex.ru>
> >>
> >> On 15/02/2023 17:48, Theodor Thornhill via Bug reports for GNU Emacs,
> >> the Swiss army knife of text editors wrote:
> >>> For indentation purposes, when RET is pressed, shouldn't we
> >>> ask about the node of the first non-whitespace character of the line
> >>> where we get RET?
> >> RET usually indents two lines now: the current one and the next.
> >>
> >> The issue is what to do about indentation on the next (opened) line.
> > Yes, I tried to suggest that for the indentation of the next line we
> > find the node that corresponds to the beginning of the current line.
> > That assumes that we already know how to indent a line after "for" (or
> > "if" or "while" or...).
> 
> If the current line is empty, we could indeed look for the node at the 
> end of the previous line.
> 
> But to determine whether that node is an opener, or a closer, or a 
> container that should have spanned the current line (or should be 
> considered to do so), I think will require grammar-specific logic.

Sure, but I thought the problem was we were using the wrong nodes.  I
presumed that, once the "right" node is found, we can thereafter use
the information of that node (which is grammar-specific) to take it
from there and determine the required indentation.  You seem to be
saying there's more there than meets the eye?




This bug report was last modified 2 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.