> Suppose we make font-lock-add-keywords with nil for MODE > record its argument in some permanent buffer-local variable. > Then changing the major mode and reenabling font-lock > would use the same keywords previously added.
Problem is that some of those keywords should be permanent and others shouldn't. E.g. it depends whether they correspond to a minor mode which is permanent or not. > That would also change the current behavior when changing a major mode > interactively. Currently, it gets rid of these keywords. When > changing modes interactively, the situation is thousands of times more > likely to occur than when changing major modes inside a derived mode. > Stefan does not seem to consider getting rid of these keywords to be > a problem when changing modes interactively, although he does consider > it a problem when it happens in a derived mode. Maybe there should be The assumption is that those keywords are added via a function placed on the major mode's hook, i.e. the keywords tweak the major mode and should thus be removed/readded when the major mode changes. Of course in other settings it should behave differently. The problem is that the API is too simplistic. Stefan _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel