From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#66159: 30.0.50; lua-ts-mode semantic indentation problems Date: Sat, 30 Sep 2023 07:52:34 +0000 Message-ID: <8734ywkshp.fsf@posteo.net> References: <87fs36vvxl.fsf@gmail.com> <87v8bz3905.fsf@pub.pink> <878r8vwm9v.fsf@gmail.com> <87il7z5g3g.fsf@pub.pink> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28173"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrey Listopadov , 66159@debbugs.gnu.org, Eli Zaretskii To: john muhl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 30 09:54:14 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 1qmUnl-0006uz-KG for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Sep 2023 09:54:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmUnM-0008LA-KW; Sat, 30 Sep 2023 03:53:48 -0400 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 1qmUnL-0008Ky-C0 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 03:53:47 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmUnL-0001jk-21 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 03:53:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmUnZ-0004Bd-UZ for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 03:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 07:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66159 X-GNU-PR-Package: emacs Original-Received: via spool by 66159-submit@debbugs.gnu.org id=B66159.169606038316000 (code B ref 66159); Sat, 30 Sep 2023 07:54:01 +0000 Original-Received: (at 66159) by debbugs.gnu.org; 30 Sep 2023 07:53:03 +0000 Original-Received: from localhost ([127.0.0.1]:57630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmUmc-00049m-9h for submit@debbugs.gnu.org; Sat, 30 Sep 2023 03:53:02 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:53973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmUmY-00049Q-Fu for 66159@debbugs.gnu.org; Sat, 30 Sep 2023 03:53:00 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2D396240028 for <66159@debbugs.gnu.org>; Sat, 30 Sep 2023 09:52:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696060357; bh=nI5rH2aFO/Fp5LMPYXqchBilSXsUGTNNWH8f3an5rQU=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=dZNJsgFj6QLzdmxhVacwzEjR9IDLsRb88KrriMGGpcx0ZgDKV4xLIxVKDs0WHzJZz LrDn6Lbpw1roVR+To3UF1Kme9u/q8smyoo+07oIBqPbjV8lIiIg7nB1iNgusesCU80 VMlnP8mEr+QKSSA7wTa0PPCemMuKAZ1k9WEnT+rg/HNB8pJOSEftY0VtQoaZaWHyyl veO0h13/1H0PQjIVqCMXzxnIm7PGVwWn2pv24Vf//NUlP1nTOzDYb4UQyW4P82bWnj 9e000/eM4e0cFphtIDGYfE2vMvmKJykxBJqmAhFvjIrHZLrp6n+J3o0+vM2sebq9aY 1hXQ0s7lURE4A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RyKFH5kd8z9rxK; Sat, 30 Sep 2023 09:52:35 +0200 (CEST) In-Reply-To: <87il7z5g3g.fsf@pub.pink> (john muhl's message of "Sun, 24 Sep 2023 13:20:23 -0500") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:271531 Archived-At: john muhl writes: > Eli Zaretskii writes: > >>> > Another thing that bothers me is that I prefer Gassanenko-style packi= ng >>> > of `end' keywords so that they vertically align with the scope of the >>> > opened block, as it saves so much vertical space and is easier for me= to >>> > read, but lua-ts-mode moves it to the latest innermost indentation >>> > level, as opposed to the outermost depending on the count of ends in = the >>> > line itself: >>>=20 >>> I don't see any reason not to support that style but I'm not sure how to >>> do it. A patch would be welcome but I'll try to figure it out sometime. >> >> Maybe introduce indentation styles into lua-ts-mode, like CC Mode and >> c-ts-mode have? > > I=E2=80=99ll have a look at what the c-ts-mode styles do and see what mig= ht be > applicable. In this case the changes can be accommodated by default. > > Andrey Listopadov writes: > >> Thanks! The patch seems to work as I would expect for most cases. >> >>> I don't see any reason not to support that style but I'm not sure how to >>> do it. A patch would be welcome but I'll try to figure it out sometime. >> >> A far as I understand it, in the `lua-mode' the overall line indentation >> is computed via subtracting indentation for every `end' in that line, >> e.g. `end end end' subtracts `lua-indent-level three times from current >> indent level. > > Thanks for the explanation. The attached patch should make end packing > work now. > >>> Sure. It's a new mode so nothing is really set in stone. Let me know if >>> you have other suggestions. >> >> I also noticed that `lua-ts-inferior-lua` for some reason starts itself >> in a new frame instead of just a new window. I haven't seen this >> behavior with other inferior-*-modes, and the `lua-start-process' >> function from `lua-mode' doesn't spawn a new frame either. >> >> Looking at the code, it seems that it was a deliberate choice, as I see >> the use of `display-buffer-pop-up-frame' in the `display-buffer' ACTION >> arg. > > It did use a window originally but I was asked to change it: > >>> + (pop-to-buffer buffer))) >> >> I believe that `display-buffer-pop-up-frame' is the preferred alternative >> to `pop-to-buffer' these days. > > Maybe I misunderstood and it was only about not using =E2=80=98pop-to-buf= fer=E2=80=99 > and should have been =E2=80=98display-buffer-pop-up-window=E2=80=99. CC= =E2=80=99d Philip for > clarification. Yes, you are right, I meant `display-buffer-pop-up-window'. > If you customize where you want it with =E2=80=98display-buffer-alist=E2= =80=99 that > should be respected.