[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: none
"ohad stauber" <stauberr@netvision.net.il> writes:
> how do i use the c-mode in xemacs in order to highlighten fonts?
Anyhow, the basics:
1) This is more appropriate for comp.emacs.xemacs
2) Xemacs has to recognize that the file is a C source. It does
it through the filename extension, and it should do it
automatically. If you suspect that it doesn't (e.g. when you
bring a C file up in a buffer the modeline does not say it is
C, but rather Fundamental or something else, check auto-mode-alist:
C-h v auto-mode-alist RET
- it should contain
("\\.[ch]\\'" . c-mode)
or
("\\.[ch]$" . c-mode)
among other things (you can search for it in the help buffer the
usual emacs way).
If you don't find it, insert
(setq auto-mode-alist
(append '(("\\.[ch]$" . c-mode)) auto-mode-alist))
into your .emacs.
3) You need font-lock for highlighing. Put the following into
your .emacs:
(require 'font-lock)
;; This is important - large buffers will be fontified stealthily
;; and much faster
(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
;; you may want to use this for maximal effect
(add-hook 'c-mode-hook #'(lambda ()
(setq c-font-lock-keywords c-font-lock-keywords-3)))
4) You can do all of the above through the Options / Syntax
Highlighting menu. It can be simpler for you to do, but it's more
difficult for me to describe. In any case, don't forget the
turn-on-lazy-lock part - I don't think it's on by default.
--
Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | oleg@NOSPAM.bfr.co.il
"... We work by wit, and not by witchcraft;
And wit depends on dilatory time." - W. Shakespeare.
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il