> > It could be easily fixed by a call to `font-lock-ensure' (at least for >> files already loaded into Emacs). >> > > Please test the attached patch. I'd like to know if there are cases when > the highlighting overhead is noticeable. > I gave it a test. The result looks good, and all matches are highlighted (regardless if the files are loaded or not). Unfortunately, it comes with a hefty overhead. The time increased from 7.5 s to 10.4 s. Also, the time is not reduced if you run it a second time, even if the files are present in Emacs buffers, indicating that font-lock is redone unnecessarily. -- Anders