> I'm not putting the "blame" on the change (which is, AFAICS, > correct), only stressing that when a function runs a hook and > *afterwards* sets the not-modified flag, protecting against the > change of the buffer is not a defense against "random crap".
Why setting the not-modified flag comes after running a hook? AFAIK, there is a convention that run-hook should be the last element in the function body, so users could override every default settings of the function, including in this particular case setting the modification flag. So it seems the correct fix is just to move (run-hooks 'occur-hook) down to be the last funcall in the `occur-1' function body. -- Juri Linkov http://www.jurta.org/emacs/ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel