For most modes, font-lock is already set up and just needs to be turned on. This can be done by
M-x font-lock-mode
or by having XEmacs automatically start it by adding lines like
(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) (add-hook 'dired-mode-hook 'turn-on-font-lock)
to your `.emacs'. See the file etc/sample.emacs
for more
examples.
if
the same amount instead of indenting the 3rd clause differently from the first two?One way is to add, to `.emacs':
(put 'if 'lisp-indent-function nil)
However, note that the package `cl-indent.el' that comes with XEmacs sets up this kind of indentation by default. `cl-indent' also knows about many other CL-specific forms. To use `cl-indent', one can do this:
(load "cl-indent") (setq lisp-indent-function (function common-lisp-indent-function))
One can also customize `cl-indent.el' so it mimics the default `if' indentation (`then' indented more than the `else'). Here's how:
(put 'if 'common-lisp-indent-function '(nil nil &body))
Also, a new version (1.2) of `cl-indent.el' was posted to `comp.emacs.xemacs' on 12/9/94. This version includes more documentation than previous versions. This may prove useful if you need to customize any indent-functions. The post can be retrieved by searching the XEmacs mail archives.
Well, first off, consider if you really want to do this. cc-mode is much more powerful than the old c-mode. But if you still insist, add the following lines to your `.emacs':
(fmakunbound 'c-mode) (makunbound 'c-mode-map) (fmakunbound 'c++-mode) (makunbound 'c++-mode-map) (makunbound 'c-style-alist) (load-library "old-c-mode") (load-library "old-c++-mode")
This must be done before any other reference is made to either c-mode or c++-mode.
This was caused by a bug in the Postscript font-lock regular expressions. It should be fixed in 19.13. For earlier versions of XEmacs, have a look at your `.emacs' file. You will probably have a line like:
(add-hook 'postscript-mode-hook 'turn-on-font-lock)
Take it out, restart XEmacs, and it won't try to fontify your postscript files anymore.
For C, C++, and Lisp, you can try adding the following to your `.emacs' file:
(setq c-font-lock-keywords c-font-lock-keywords-2) (setq c++-font-lock-keywords c++-font-lock-keywords-2) (setq lisp-font-lock-keywords lisp-font-lock-keywords-2)