Subject: bug#21793: Emacs hangs in sh-mode

From: Tassilo Horn <[email-masked]>
Date: Sat, 31 Oct 2015 07:02:53 +0100

"jun" <[email-masked]> writes:

Hi!

> Run emacs with "emacs -Q". Open the attached file. Turn on
> show-paren-mode.  Then let cursor stay on word "while" or "do". Emacs
> hangs.
>
> Emacs version: 24.5 on Linux.
> #!/bin/sh
>
> while [ 1 -gt 0]
> do

I can't reproduce this with emacs 24.5, but given your example and
description, I think this is a duplicate of

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21747

which I have fixed in 1bab3cefc133e06aaf4a48efb1623d1b458ab212.

  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1bab3cefc133e06aaf4a48efb1623d1b458ab212

If you can do that, could you please check if applying that patch to
your sh-script.el fixes the problem?  (Be sure to recompile it
afterwards.)

Bye,
Tassilo