From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#55764: 29.0.50; sh-mode: Support mksh's alternate case brace syntax Date: Sat, 30 Sep 2023 23:37:28 -0400 Message-ID: References: <87o7zbp4uc.fsf@gmail.com> <87o7zbw5dz.fsf@gnus.org> <87k09zp3kh.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38131"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Lars Ingebrigtsen , 55764@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 01 05:38: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 1qmnHa-0009U4-JA for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Oct 2023 05:38:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmnHC-0002Ao-BM; Sat, 30 Sep 2023 23:37:50 -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 1qmnH9-0002Ae-00 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 23:37: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 1qmnH8-00087F-Nn for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 23:37:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmnHN-0007q5-NQ for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 23:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Oct 2023 03:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55764 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55764-submit@debbugs.gnu.org id=B55764.169613147430116 (code B ref 55764); Sun, 01 Oct 2023 03:38:01 +0000 Original-Received: (at 55764) by debbugs.gnu.org; 1 Oct 2023 03:37:54 +0000 Original-Received: from localhost ([127.0.0.1]:60278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmnHG-0007pg-4D for submit@debbugs.gnu.org; Sat, 30 Sep 2023 23:37:54 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmnHE-0007pR-5V for 55764@debbugs.gnu.org; Sat, 30 Sep 2023 23:37:53 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8432B805A9; Sat, 30 Sep 2023 23:37:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1696131449; bh=u97+Oko0Ol2gKjSaUP514GqXWDtVztqax2cmrTXG70Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=h06gHppeip6/bFgUXM6DmzeFwYcc/6WZYCOLcK2di8Aya2OVrxhk2XKMvzkWFUsIe s5mFwYrTkX9mtSjkRThpkOiqQ90QJEnVUbBznIo5w42Wxpz6DPnkGTUPpIgwTkx09/ uQqtmXC2diXn/aOn7WzuXdiWP4aIchgqo2pQK2x6tb+qDQabUfcqQsWxJKM9h37Ho+ D9SvCOJ3ureD/Stu2HAR9Fs9q06Fpx4xUT5D5lpNwTb7QO9uBRwcvQoRqbxEH5uCuq qRkeiHFJzTnkaIT9DhIVGvFMZDfMqRSwzwsJFt+HOnlAU0KLzZEjF3T62k+7uaYiWm hf4bwGq5tostg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3E124803EB; Sat, 30 Sep 2023 23:37:29 -0400 (EDT) Original-Received: from pastel (unknown [216.154.20.132]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 10EFB120321; Sat, 30 Sep 2023 23:37:29 -0400 (EDT) In-Reply-To: <87k09zp3kh.fsf@gmail.com> (Visuwesh's message of "Thu, 02 Jun 2022 19:31:18 +0530") 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:271589 Archived-At: --=-=-= Content-Type: text/plain > To no one's surprise, the patch is not the right approach. IIUC, when I > use braces, *pattern) thingies are not recognised as "case-)" anymore so > sh-indent-for-case-label does not get applied. I tried a bit more but I > only got it to respect the first line but still it is definitely not the > right approach, The first part of the puzzle is to fix the syntax-category of the `)` so it's recognized as a "case-)" rather than a normal ("matched") paren. The patch below seems to do the trick. Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=openbsd-case.patch diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index cc521cb0591..b34be83367a 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1053,7 +1053,8 @@ sh-font-lock-paren ;; a normal command rather than the real `in' keyword. ;; I.e. we should look back to try and find the ;; corresponding `case'. - (and (looking-at ";\\(?:;&?\\|[&|]\\)\\|\\_