From eac3f2a80778b3904c55ae7b65ff862a79eebf2a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 11 Jan 2024 22:12:34 -0500 Subject: [PATCH] sh-script.el: Add support for `case FOO {...}` (bug#55764) * lisp/progmodes/sh-script.el (sh-font-lock-paren): Also recognize `FOO)` after `{`. (sh-smie-sh-rules): Make `for` rule apply to `case FOO { ...}` as well. * test/manual/indent/shell.sh: Add new test case. --- lisp/progmodes/sh-script.el | 7 ++++--- test/manual/indent/shell.sh | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 0562415b4e5..2a650fe0ea6 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1054,7 +1054,8 @@ 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 ";\\(?:;&?\\|[&|]\\)\\|\\_