From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61502: 29.0.60; c-ts-mode auto-indent not working Date: Wed, 15 Feb 2023 20:11:43 +0200 Message-ID: <83r0uqajds.fsf@gnu.org> References: <87v8k4g8xu.fsf@codeisgreat.org> <83a61ge69s.fsf@gnu.org> <87edqs11db.fsf@thornhill.no> <83a61gc8xx.fsf@gnu.org> <875yc40zhu.fsf@thornhill.no> <838rgzce0c.fsf@gnu.org> <873577qewk.fsf@thornhill.no> <83lekzauvz.fsf@gnu.org> <87ttzn2enc.fsf@thornhill.no> <83bklvatrj.fsf@gnu.org> <87r0ur6kv1.fsf@thornhill.no> <83a61fas5w.fsf@gnu.org> <6AAA6F2C-605C-4C90-9B3B-9223A9707A43@thornhill.no> <10bea2f6-6439-87fa-6523-1f992e396822@yandex.ru> <833576c0r3.fsf@gnu.org> <00df07a1-4c58-95ec-81ae-fb43cd1626a8@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34975"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61502@debbugs.gnu.org, casouri@gmail.com, theo@thornhill.no, pankaj@codeisgreat.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 19:13:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSMHK-0008uo-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 19:13:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSMHA-0007uL-LE; Wed, 15 Feb 2023 13:13:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMH8-0007r3-V3 for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 13:13:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSMH8-0002gY-LU for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSMH8-0003wz-Aq for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 13:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61502 X-GNU-PR-Package: emacs Original-Received: via spool by 61502-submit@debbugs.gnu.org id=B61502.167648473215122 (code B ref 61502); Wed, 15 Feb 2023 18:13:02 +0000 Original-Received: (at 61502) by debbugs.gnu.org; 15 Feb 2023 18:12:12 +0000 Original-Received: from localhost ([127.0.0.1]:33924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSMGK-0003vp-9B for submit@debbugs.gnu.org; Wed, 15 Feb 2023 13:12:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSMGI-0003vd-Aj for 61502@debbugs.gnu.org; Wed, 15 Feb 2023 13:12:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMGA-0002co-Mz; Wed, 15 Feb 2023 13:12:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZlhbrFF1m10SoeymKi3kPk62QhTrEsYaxAbyMCP/dOc=; b=TdvKD4dRntFl ypH0OjGT9g/Caqi6xPeHABusrP4KlOtZyMtqE3qJVf+3VhV3G1xTNkXIg+sqLnCbMTNDHApFcrooA vFVjxanEnwUVvolyYnHpjBmRhuvMRUcgm2H9aXBaD696MtR9pp2Nm1ssgXJE5852OB8BULn8fZRPb 8IqPcFytNm9667Dho/H3nk/8Ra9yvoyxOXvh2+7UQOyUXi9xnRElfCkWP1iPlZlnMvpC2RUckRkl9 tSH3Jm3QK7sN4WkpaQKuZYzf3kTqtjxCBpIP6snQXglPTxpbPK/dFjNtyR0GZR6ZKCuKeFANQhDD8 eXGMudS3r9EtWTdDpAakLA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMG9-0006DY-Vp; Wed, 15 Feb 2023 13:12:02 -0500 In-Reply-To: <00df07a1-4c58-95ec-81ae-fb43cd1626a8@yandex.ru> (message from Dmitry Gutov on Wed, 15 Feb 2023 19:57:04 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255757 Archived-At: > Date: Wed, 15 Feb 2023 19:57:04 +0200 > Cc: 61502@debbugs.gnu.org, casouri@gmail.com, theo@thornhill.no, > pankaj@codeisgreat.org > From: Dmitry Gutov > > On 15/02/2023 19:11, Eli Zaretskii wrote: > >> Date: Wed, 15 Feb 2023 17:57:51 +0200 > >> Cc:61502@debbugs.gnu.org,casouri@gmail.com,pankaj@codeisgreat.org > >> From: Dmitry Gutov > >> > >> 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?