unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philippe Altherr <philippe.altherr@gmail.com>
Cc: 60833@debbugs.gnu.org
Subject: bug#60833: [PATCH] sh-script.el: Add support for Zsh's case branches ; |.
Date: Sat, 21 Jan 2023 09:33:12 +0200	[thread overview]
Message-ID: <837cxgmjev.fsf@gnu.org> (raw)
In-Reply-To: <CAGdYchviHhiFXvOkP0+8uJnwnjZ7koeMWYKJebVEc-VmspNZ5g@mail.gmail.com> (message from Philippe Altherr on Sun, 15 Jan 2023 14:28:08 +0100)

> From: Philippe Altherr <philippe.altherr@gmail.com>
> 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.





  reply	other threads:[~2023-01-21  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 13:28 bug#60833: [PATCH] sh-script.el: Add support for Zsh's case branches ; | Philippe Altherr
2023-01-21  7:33 ` Eli Zaretskii [this message]
2023-01-23  4:13   ` Philippe Altherr
2023-01-23 15:16     ` Eli Zaretskii
     [not found] ` <handler.60833.B.16737920195794.ack@debbugs.gnu.org>
2023-02-17 15:20   ` bug#60833: Acknowledgement ([PATCH] sh-script.el: Add support for Zsh's case branches ; |.) Philippe Altherr
2023-03-02 10:50     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837cxgmjev.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60833@debbugs.gnu.org \
    --cc=philippe.altherr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).