In an awk buffer having the following text: #--BEGIN-- NF { /xyz/ } NF { /xyz/ } #--END-- I have the second regexp properly font-locked but not the first one. (tested in GNU Emacs 24.2.92.1 of 2013-01-13)