Subject: bug#16500: 24.3.50; Wrong font-lock backquote highlighting in plan9 rc variant of sh-mode

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 30 Oct 2019 14:55:18 +0100

Mikhail Gusarov <[email-masked]> writes:

> sh-quoted-exec face recognized by rc variant of sh-mode is not
> terminated at the end of quoted expression. To reproduce this bug,
> enable the font lock and open the following file in Emacs
> (alternatively remove {} around foo):
> ----------------------------------------------------------------------
> #!rc
>
> `{foo}   bar
> baz
> ----------------------------------------------------------------------
>
> Check with e.g. what-cursor-position that sh-quoted-exec face is
> continuing until the end of file, or up to a next ` symbol.
>
> sh-quoted-exec face should apply only to the closing } symbol, or,
> if the word quoted is not bracketed, to the end of word.

The problem here seems to be that ` is defined in the syntax table to be
a quote character, so `parse-partial-sexp` will skip to the end of the
buffer (or the next ` character) in
font-lock-fontify-syntactically-region.

I'm trying to familiarise myself with how font locking is supposed to
work -- anybody know what I should be poking into to get this to work
better?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no