-- John Paul Wallington <jpw(a)shootybangbang.com> spake thusly:
Chris Ball <chris(a)void.printf.net> wrote:
>>>>>> "jpw" == John Paul Wallington
<jpw(a)shootybangbang.com> writes:
>
> jpw> How does an XEmacs user get font-lock automatically for
> modes jpw> that don't visit files (eg: M-x ielm) ?
>
> The same method as for other modes; enable it globally. The
> incantation you're looking for is probably "(setq
> global-font-lock-mode t)".
No.
There is no such variable. Nor is there a global-font-lock-mode
function.
This is a GNU Emacs thing. The XEmacs equivalent seems to be
font-lock-auto-fontify, which by default is t. It's also necessary,
however, that Emacs know the major mode of the buffer and that said
major mode supports font-lock. This also apparently only happens
automatically for files. From the bottom of font-lock.el:
;; Install ourselves:
(add-hook 'find-file-hooks 'font-lock-set-defaults t)
Presumably it's up to other modes to enable font-lock themselves. Or
you could add to your .emacs:
(add-hook 'ielm-mode-hook 'turn-on-font-lock)
but that only solves the individual case. I don't know of a way to get
this to happen for all modes that support font-lock. I couldn't find a
hook that's run after setting a major mode. There's
change-major-mode-hook, but this seems to get run _before_, which
wouldn't help.