On 03/16/2015 12:07 AM, Tassilo Horn wrote: > Stefan Monnier writes: > >>> Finally, I'm positively surprised at how fast the update function is. >>> I would have expected some lag, but haven't found any (even though I'm >>> looking). >> >> Loading Elisp files should be fairly rare. But there might be cases >> where it can be done repeatedly, but if/when faced with such a situation >> we should be able to handle it efficiently e.g. by checking the >> load-history (make sure the file did include some definitions before we >> bother to scan symbols and rebuild the regexp) since such "run-time >> loading" probably won't define new functions. > > Like so? Instead of doing it this way, why not make a font-lock matcher that looks at *every* initial sexp atom, calls intern-soft on it, and applies a face that depends on properties of the found symbol? This way, we'd update fontification not only after load, but also after eval-defun, and it'd be easy to make a `declare'-form that provided for exceptions from the general rule. cc-mode uses a system like this for keywords, and I think it's what Stefan was talking about earlier.