There's something hairy about autoload cookies with derived modes. An
example of this would be php-mode.el from prog-modes. The version
currently in CVS doesn't work as it should out of the box, when doing a
"xemacs some_file.php" with it, I get:
Symbol's value as variable is void: php-font-lock-keywords-3
The solution of course is not to add autoload cookies to all
def(var|un)'s and the like. Adding (require 'php-mode) to init.el would
help, but it's not "out of the box".
One workaround is to put an autoload cookie into a dummy autoload,
instead of the derived mode. The patch below fixes php-mode for me, as
well as the sml-mode package from unsupported/scop, which after this
hack, is finally working in XEmacs :)
Maybe The Right Thing would be to "fix" derived.el? Anyway, I'll commit
this one unless someone tells me that it's horribly wrong and will break
when/if define-derived-mode works like a defun with autoload cookies.
Of course, better ideas/fixes are appreciated.
Index: php-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/prog-modes/php-mode.el,v
retrieving revision 1.8
diff -a -u -r1.8 php-mode.el
--- php-mode.el 2002/07/15 19:37:27 1.8
+++ php-mode.el 2002/07/31 22:48:07
@@ -219,7 +219,9 @@
(defconst xemacsp (string-match "Lucid\\|XEmacs" emacs-version)
"Non nil if using XEmacs.")
+;; XEmacs hack: autoload a dummy autoload instead of a derived mode.
;;;###autoload
+(autoload 'php-mode "php-mode")
(define-derived-mode php-mode c-mode "PHP"
"Major mode for editing PHP code.\n\n\\{php-mode-map}"
--
\/ille Skyttä
ville.skytta at
xemacs.org