JCW's [X]Emacs stuff
As you may expect, this page contains the stuff I had to write in order to
make my XEmacs work the way I want it to.
C++ code intendation/highlightong for Qt code
I prepared two following files:
- qtcc-mode.el.gz (1.5kB) - a simple
code that contains QtC++ minor mode to control intendation of Qt
sources (most of all class declarations in headerfiles)
- qtfont-lock.el.gz (29kB) - a
straight-forward derivation of original font-lock.el file
that adds the proper syntax highlighting of Qt sources.
If you want to use the above files just grab them and ungzip to your emacs
related directory (I use $HOME/lib/emacs). After this you only have
to modify your .emacs file a bit by adding the following stuff:
;; At first append the directory where you put the files to load path
;; of emacs (so that you don't have to specify full path when loading
;; them).
(setq load-path
(append load-path '("path to the downloaded .el files")))
;; When entering the C++ mode, load both files and jump directly into the
;; QtC++ minor mode. You may wish to skip this last step; in this case
;; just remove the line with "(qtc++-mode)" and feel free to invoke the
;; QtC++ minor mode using 'M-x qtc++-mode'.
(add-hook 'c++-mode-hook
(lambda()
(load-library "qtcc-mode")
(load-library "qtfont-lock")
(qtc++-mode)
))
Once you've done it, you directly see the improvement in the vay that emacs
treats Qt source files. There might be a lot of bugs/unwanted features/side
effects that come with the above files (and the way they're installed).
Unfortunately I know nothing about LISP programming and I got to this point
just by trial_and_error method (with a little help from 'man regexp'), so
don't count on quick bug-fixes or things like this. Feel free however to
mail me your problems, bugs, solutions etc.
Jacek Wojdel
Last modified: Tue Sep 21 17:48:34 MET DST 1999