If you call font-lock-{add,remove}-keywords with nil for MODE inside a parent mode's body instead of its mode hook, the keyword is not enabled in the derived mode. If the parent mode does call font-lock-{add,remove}-keywords in its mode hook, the keyword may not be enabled in the derived mode if any involved mode does not follow the new conventions.
Thanks. I think the right solution is simply "don't do that, then". Major mode functions should not call font-lock-add-keywords or font-lock-remove-keywords (though the mode hooks may do so). I will add this to the documentation of font-lock-add-keywords. @strong{Warning:} major mode functions must not call @code{font-lock-add-keywords} under any circumstances, either directly or indirectly. (This would lead to incorrect behavior for some minor modes.) They should set up for Font Lock mode by setting @code{font-lock-keywords}. Problems remain with for minor modes that call font-lock-{add,remove}-keywords with nil for MODE and add it to the hook of a major mode that does not follow the conventions or has an ancestor that does not. Do you consider this to be a problem that needs to be fixed before the next release? Fixing it would require non-trivial changes to Font Lock. We don't need to fix this. Those modes should be fixed. So, please install your patch. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel