From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#26217: bug#2910: 23.0.60; Shell-script coloring bug Date: Sat, 14 Oct 2023 09:44:37 -0300 Message-ID: <4c33c246-b993-4d09-bbd3-9687472c8010@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------VvBoEAqe36oFvDjQu7WGVmlD" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22189"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Martin Vath , 26217@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 14:46: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 1qre23-0005YC-AU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 14:46:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qre1l-0008Jx-HE; Sat, 14 Oct 2023 08:45:58 -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 1qre1T-0008HK-5U for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:45:45 -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 1qre1S-0001TX-Qv for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:45:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qre1q-0004J1-CT for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 08:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 12:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26217 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 26217-submit@debbugs.gnu.org id=B26217.169728751316460 (code B ref 26217); Sat, 14 Oct 2023 12:46:02 +0000 Original-Received: (at 26217) by debbugs.gnu.org; 14 Oct 2023 12:45:13 +0000 Original-Received: from localhost ([127.0.0.1]:48089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qre12-0004HP-Bw for submit@debbugs.gnu.org; Sat, 14 Oct 2023 08:45:12 -0400 Original-Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:57468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qre10-0004H9-KS; Sat, 14 Oct 2023 08:45:11 -0400 Original-Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6c4e30a3604so1963976a34.2; Sat, 14 Oct 2023 05:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697287481; x=1697892281; darn=debbugs.gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=9jJsozgNtKQnMjnVPf8f/45ydOS2/7pP8+Tq1mq5ros=; b=LXnMgLymaEbmfdouV6RzFVE5JhyiwL7fdSuDA+K4/IAjpjGtaG1dCqV5+Qwe6KN+9/ suQixaaiY5I8u+wEkBIfSnOA7MbhYdZ4tmNqOwlHAi1Ntkma2IRT5FCjZdXydddpYhi3 3mTBsr4PBGc2J922Rpxy3opX14RjcQmL4grrzSZDVyuMqDI4YmtMrq2h/nLMohFz4Lub 5NfpOI0+3ESQKs0jdhAalpP4m2g09j3zyWXaFDbJIjmKzOwzFp2zl7t+I0Ex60O8wSom W+24xkDNs/c5dV8AJmzYlmk1cRnsQ15oG/D6kTjn7+ajc9kqS9LA+C8gU4POmvPCmjx2 YL4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697287481; x=1697892281; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9jJsozgNtKQnMjnVPf8f/45ydOS2/7pP8+Tq1mq5ros=; b=QycML30/nZXxZ7eAQTbKWFHM7mZ1effu5dFAgJkmWzO9k/KvhGS39fHpl1JN9N+skk ZuHnqc40qXES8zorcJ2BgXXiBZJAsEEAwjUrkCq4kKC5ia9XGc4FytIESRJBW2hJQYsh xCHEa1VvT5k4DHui3VrCOhUXpUhCKGkuGGNwl7illFtWbm7vePqWVQrFcSFVed2ZStRc E6yAoKMJ+6rsU78JZsSAKyiC3mdlfJUcObV/Mr3kESb6VV9S9A2ohq5DROWqfq8Pmt++ XUl1Vgx/E2TMkpJSGlqjL0xIbTjtLmy4atMiDzv3LcO3MQMnwRndw0IPXzb8LqoC8wXS hnVA== X-Gm-Message-State: AOJu0YwRk6I+I0yWDnnBZHTH8iamAjDFUrQ2fQSkWWjmDYsg5t5TBd3j 6+/1cf+cNTxr6QqoOFz9JPZhWUwICHcgfw== X-Google-Smtp-Source: AGHT+IH35m2WM2v1wZ1wCee2HoKG/wbYNHPZ5FUugQsXZcaCpCRHQFRW5cGKEEujmIXcLrXAFP1bGw== X-Received: by 2002:a05:6830:c4:b0:6bf:2476:a97e with SMTP id x4-20020a05683000c400b006bf2476a97emr30598154oto.5.1697287481205; Sat, 14 Oct 2023 05:44:41 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id z15-20020aa7948f000000b006933866f49dsm967351pfk.19.2023.10.14.05.44.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Oct 2023 05:44:40 -0700 (PDT) Content-Language: en-US In-Reply-To: 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:272415 Archived-At: This is a multi-part message in MIME format. --------------VvBoEAqe36oFvDjQu7WGVmlD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit tags 26217 patch quit On 13/10/23 13:06, Stefan Monnier wrote: >> I don't know what's the decision (if there is one) about situations like >> these.  If the bugs in lang-mode are fixed by lang-ts-mode, will these >> bug reports be treated as: wontfix? fixed? open in case someone wants to >> spend time in lang-mode? > > AFAIK we don't consider the `foo-ts-mode` to obsolete the other modes. > Maybe we will, but we don't yet.  IMO I think we'd first need to have > a good long-term strategy about what we'll do when tree-sitter becomes > unmaintained/obsolete.  IOW I think we need to develop our own layer of > abstraction above tree-sitter so that we can accommodate other > parser backends. > > FWIW, it's not clear at all what such a layer would look like, so we're > pretty far from it.  I'd welcome people start thinking about it, maybe > by looking at existing alternatives like our own `wisi` (in GNU ELPA), > SMIE, maybe LSP (assuming there are servers out there which can provide > that kind of functionality), etc... Thank you for your response.  I don't know if this has been raised in emacs-devel, but IMO it should be. >> - Wrong indentation for lines after: >> for i do echo 1; done >> >> I took a look at this, and ISTM that giving "do" a special treatment >> like sh-smie--sh-keyword-p gives to "in" might fix this, perhaps by >> reusing sh-smie--sh-keyword-in-p. > > Sounds about right. I attach a patch that should also handle the fontification issue. It also comes with some tests, and I've did some manual testing on my own. I haven't found problems, but I'm suspicious because it seems too easy. --------------VvBoEAqe36oFvDjQu7WGVmlD Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-indentation-and-fontification-in-shell-script-Bu.patch" Content-Disposition: attachment; filename*0="0001-Fix-indentation-and-fontification-in-shell-script-Bu.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA0MjBmYmZjMWIyNjUxODM5ZjIxNGVkYmQ4MDlhNjYzZjQyZGNmMDgwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBNYXVybyBBcmFuZGEgPG1hdXJvb2FyYW5kYUBnbWFp bC5jb20+CkRhdGU6IFNhdCwgMTQgT2N0IDIwMjMgMDk6MDU6MzUgLTAzMDAKU3ViamVjdDog W1BBVENIXSBGaXggaW5kZW50YXRpb24gYW5kIGZvbnRpZmljYXRpb24gaW4gc2hlbGwtc2Ny aXB0IChCdWcjMjYyMTcpCgoqIGxpc3AvcHJvZ21vZGVzL3NoLXNjcmlwdC5lbCAoc2gtc21p ZS0tc2gta2V5d29yZC1wKTogVHJlYXQgImRvIiBhcwpzcGVjaWFsLCBsaWtlIHdlIHRyZWF0 ICJpbiIuCihzaC1zbWllLS1zaC1rZXl3b3JkLWluLXApOiBDaGFuZ2Ugc2lnbmF0dXJlLiAg VGFrZSB0aGUgdG9rZW4gdG8KZGVjaWRlIGNvcnJlY3RseSBpZiBpdCdzIGEga2V5d29yZC4K KHNoLWZvbnQtbG9jay1rZXl3b3Jkcy12YXItMSk6IEFkZCBkby4KCiogdGVzdC9saXNwL3By b2dtb2Rlcy9zaC1zY3JpcHQtcmVzb3VyY2VzL3NoLWluZGVudHMuZXJ0czogTmV3IHRlc3Qu CiogdGVzdC9saXNwL3Byb2dtb2Rlcy9za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LWxvY2sta2V5d29yZHMtdmFyLTIgKCkKQEAgLTE4MDksOCAr MTgwOSw4IEBAIHNoLXNtaWUtLXNoLW9wZXJhdG9ycy1iYWNrLXJlCiAgIChjb25jYXQgIlxc KD86XlxcfFteXFxdXFwpXFwoPzpcXFxcXFxcXFxcKSoiCiAgICAgICAgICAgIlxcKCIgc2gt c21pZS0tc2gtb3BlcmF0b3JzLXJlICJcXCkiKSkKIAotKGRlZnVuIHNoLXNtaWUtLXNoLWtl eXdvcmQtaW4tcCAoKQotICAiQXNzdW1pbmcgd2UncmUgbG9va2luZyBhdCBcImluXCIsIHJl dHVybiBub24tbmlsIGlmIGl0J3MgYSBrZXl3b3JkLgorKGRlZnVuIHNoLXNtaWUtLXNoLWtl eXdvcmQtaW4vZG8tcCAodG9rKQorICAiV2hlbiBsb29raW5nIGF0IFRPSyAoZWl0aGVyIFwi aW5cIiBvciBcImRvXCIpLCBub24tbmlsIGlmIFRPSyBpcyBhIGtleXdvcmQuCiBEb2VzIG5v dCBwcmVzZXJ2ZSBwb2ludC4iCiAgIChsZXQgKChmb3J3YXJkLXNleHAtZnVuY3Rpb24gbmls KQogICAgICAgICAod29yZHMgbmlsKSAgICAgICAgICAgICAgICAgICAgIDtXZSd2ZSBzZWVu IHdvcmRzLgpAQCAtMTgzMiw3ICsxODMyLDEwIEBAIHNoLXNtaWUtLXNoLWtleXdvcmQtaW4t cAogICAgICAgICgoZXF1YWwgcHJldiAiOyIpCiAgICAgICAgIChpZiB3b3JkcyAoc2V0cSBu ZXdsaW5lIHQpCiAgICAgICAgICAgKHNldHEgcmVzICdrZXl3b3JkKSkpCi0gICAgICAgKCht ZW1iZXIgcHJldiAnKCJjYXNlIiAiZm9yIiAic2VsZWN0IikpIChzZXRxIHJlcyAna2V5d29y ZCkpCisgICAgICAgKChtZW1iZXIgcHJldiAoaWYgKHN0cmluZz0gdG9rICJpbiIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgJygiY2FzZSIgImZvciIgInNlbGVj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