Subject: Re: bug#6463: "prepend" font-locking not working when an sh-mode buffer is opened for the first time

From: Glenn Morris <[email-masked]>
Date: Sat, 19 Jun 2010 02:11:53 -0400

Ken Hori wrote:

> "prepend" font-lock keyword entries for sh-mode don't render as they
> are intended when I open an sh-mode buffer for the first time.
>
> If I close the buffer and open it again, everything works fine.
>
> Example:
> ("##+ \\(.+\\)$" 1 some-face prepend)
> won't render correctly.

Please provide a _complete_ example starting from emacs -Q, and state
what version of Emacs you are using.

The following works for me in 22.3, 23.1, 23.2, emacs-23 branch, and trunk:

cat 1.el:

(font-lock-add-keywords 'sh-mode
                        '(("##+ \\(.+\\)$" 1 'underline prepend)))

cat foo.sh:

# single
## double

emacs -Q -l ./1.el ./foo.sh 

"double" is underlined and red.