Your code looks good to me, except for one point: every major mode's symbol name should be a function that *unconditionally* switches to that mode. You've set it up so that `image-mode' is a function that usually switches to Image mode, but not always. That's not right.
So I think you should leave the function `image-mode' unchanged and define a new function `image-mode-maybe' which does the new job. Then the entries in auto-mode-alist can call `image-mode-maybe' and `image-mode-maybe' can conditionally call `image-mode'. Want to try it that way? _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel