Hiyall,
as far as you know is there an emacs package
for CLOS syntax highlighting. If so where i can
find it ?
I ask it 'cause in "non-CLOS" situations
you don't use keywords such as:
- :initform
- :initarg
- :type
- :reader
- :accessor
... which are of common use in CLOS.
Otherwise would ou suggest me how to extend
the list of lisp keywords (defun, let, ...)??
Bye
-s.
--
+---------------------------------------------+
| Cesare Rocchi |
| Research Consultant |
| at ITC-IRST Povo I-38050 (TRENTO) ITALY |
| http://tcc.itc.it/people/rocchi.html |
| |
|"Beauty is truth, truth beauty,"-that is all |
| Ye know on earth, and all ye need to know. |
| (J. Keats) |
|---------------------------------------------+
> as far as you know is there an emacs package
> for CLOS syntax highlighting. If so where i can
> find it ?
Well, syntax highlighting is not the easiest thing to do for CLOS, but
keyword highlighting is. All keywords are already highlighted by
ILISP. Does that address your need?
joelh
Joel Ray Holveck <·····@juniper.net> writes:
> > as far as you know is there an emacs package
> > for CLOS syntax highlighting. If so where i can
> > find it ?
>
> Well, syntax highlighting is not the easiest thing to do for CLOS, but
> keyword highlighting is. All keywords are already highlighted by
> ILISP. Does that address your need?
Correction. ILISP does neither highlighting nor indenting. These are
left to font-lock (unless you use something else) and to
cl-indent-function in (X)Emacs.
What you need, is an extended font lock definition to properly
highlight CL code.
Here is what I use. It may not be complete, but it is a start. Note
that this is archaeological debris from my Emacs setup. I bet that
you can find something newer and more sophisticated.
Cheers
==============================================================================
;;; -*- Mode: Emacs-Lisp -*-
;;; font-lock-cltl-mode.el --
;;; Extra highlighting for Common Lisp.
(font-lock-add-keywords 'lisp-mode
(list
(list
(concat "(\\(def"
"\\("
(concat "\\(constant"
"\\|parameter\\)"
)
"\\|"
(concat "\\(package"
"\\|setf"
"\\|generic"
"\\|method"
"\\|ine-"
(concat "\\(compiler-macro"
"\\|condition"
"\\|method-combination"
"\\|modify-macro"
"\\|setf-expander"
"\\|setf-method"
"\\|symbol-macro\\)"
"\\)")
"\\)")
"\\)"
"[ \t'\(]*"
"\\(\\sw+\\)?"
)
'(1 font-lock-keyword-face)
'(6 (cond ((match-beginning 3)
font-lock-variable-name-face)
((match-beginning 4)
font-lock-function-name-face)
(t font-lock-type-face))
nil t)
)))
(font-lock-add-keywords 'lisp-mode
(list
(list
(concat "("
"\\("
(concat "\\("
(concat "\\(restart\\|handler\\)"
"-"
"\\(bind\\|case\\)")
"\\|error"
"\\|c?error"
"\\|signal[^-]"
"\\|warn"
"\\|break"
"\\|abort"
"\\|with-\\(condition\\|simple\\)-restarts?"
"\\)")
"\\)")
'(1 font-lock-keyword-face)
)))
;;; end of file -- font-lock-cltl-mode.el --
==============================================================================
--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.