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#60833: [PATCH] sh-script.el: Add support for Zsh's case branches ; |. Date: Sat, 21 Jan 2023 09:33:12 +0200 Message-ID: <837cxgmjev.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60833@debbugs.gnu.org To: Philippe Altherr Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 21 08:34:21 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 1pJ8OL-0005VP-Gz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Jan 2023 08:34:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJ8O5-00076z-Ez; Sat, 21 Jan 2023 02:34:05 -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 1pJ8O3-00076l-LG for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 02:34:03 -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 1pJ8O2-0001a8-H4 for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 02:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJ8O2-0001IP-6G for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 02:34: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: Sat, 21 Jan 2023 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60833 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60833-submit@debbugs.gnu.org id=B60833.16742863984923 (code B ref 60833); Sat, 21 Jan 2023 07:34:02 +0000 Original-Received: (at 60833) by debbugs.gnu.org; 21 Jan 2023 07:33:18 +0000 Original-Received: from localhost ([127.0.0.1]:47850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ8NK-0001HL-He for submit@debbugs.gnu.org; Sat, 21 Jan 2023 02:33:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ8NI-0001H7-9p for 60833@debbugs.gnu.org; Sat, 21 Jan 2023 02:33:16 -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 1pJ8NC-000147-K7; Sat, 21 Jan 2023 02:33:10 -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=v2/4MJgpIy9r9bNYogHi1fh6A4KivYp9tyhwE7HoZBU=; b=iDtda68g6Z2o FksT2aZs5zcJbIm+PPw1DKMH4N+1ZUdBpSrBxletPISKEpYhsjn87qigU/COdnEthcen4P94tmNw6 P0Cwk5t+9Ooa69bXvg3ghXYFRtejXm/7esXxU7fDgoXDNXvMdFEGAZqNAZSfLfXtXMtAXzwr2eVVO Y7yuI2DKnsaOn3r/vi/n8TAyDlt9xSUbS9/ra96rquJBgEFDgG3C0lLSp4VMHcDsT/6jzMGJ8N12N fMPxYcBEJE336jfiiR2jdQ58/ZbyXYBwkYZRlRrFhdIXHj41QemyxEtVIgDVEaZ++vW1cLZ4+78UJ yMpxCBYalZ9wW50vXSfXGQ==; 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 1pJ8NB-00052Q-QV; Sat, 21 Jan 2023 02:33:10 -0500 In-Reply-To: (message from Philippe Altherr on Sun, 15 Jan 2023 14:28:08 +0100) 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:253828 Archived-At: > From: Philippe Altherr > Date: Sun, 15 Jan 2023 14:28:08 +0100 > > In shell scripts, case branches traditionally end with ;;. Bash additionally supports case branches ending with > ;& and ;;&. Zsh similarly supports case branches ending with ;& and ;|. Currently sh-script.el supports case > branches ending with ;;, ;&, and ;;&, but not with ;|. The attached patch adds support for case branches > ending with ;|. > > I have tested the patch by defining all the modified functions (sh-smie-sh-rules, sh-font-lock-paren) and > constants (sh-smie-sh-grammar, sh-smie-rc-grammar, sh-smie--sh-operators, sh-smie--sh-operators-re, > sh-smie--sh-operators-back-re) in my .emacs (in a (with-eval-after-load 'sh-script ...) statement). > > Here is an example indented without the patch: > > case $input in > *a* ) echo A;; > *b* ) echo B;& > *c* ) echo C;;& > *d* ) echo D;| > *e* ) echo E;; > esac > > and with the (simulated) patch: > > case $input in > *a* ) echo A;; > *b* ) echo B;& > *c* ) echo C;;& > *d* ) echo D;| > *e* ) echo E;; > esac Thanks. First, would it be possible to add tests for these situations? And second, your contributions (this and the other one) are larger than we can accept without your assigning the copyright to the FSF. Would you like to start your legal paperwork at this time, so that we could accept the changes after it is completed? If so, I will send you the form to fill. Thanks again for your interest in Emacs.