From: Philippe Altherr Date: Sun, 15 Jan 2023 12:37:00 +0000 (+0100) Subject: Add support for Zsh's case branches ;|. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68f49083af7ac5ffd9cde4bc7167d4e2ccbba4b6;p=emacs.git Add support for Zsh's case branches ;|. * lisp/progmodes/sh-script.el (sh-font-lock-paren) (sh-smie-sh-grammar, sh-smie-sh-rules, sh-smie-rc-grammar): Support case branches ending with ";|", per Zsh. (Bug#60833) * test/manual/indent/shell.sh (bar): Add ";|". --- diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 741803a5175..398a2c8946b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1042,7 +1042,9 @@ subshells can nest." ;; Maybe we've bumped into an escaped newline. (sh-is-quoted-p (point))) (backward-char 1)) - (when (eq (char-before) ?|) + (when (and + (eq (char-before) ?|) + (not (eq (char-before (1- (point))) ?\;))) (backward-char 1) t))) (and (> (point) (1+ (point-min))) (progn (backward-char 2) @@ -1053,7 +1055,7 @@ subshells can nest." ;; 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 ";[;&]\\|\\_