[slime-devel] cl-indent / font-lock
Pascal J.Bourguignon
pjb at informatimago.com
Sat Oct 9 17:05:36 UTC 2004
In my pjb-cl-faces.el file you can find some Common-Lisp font-locking.
I've gathered all Common-Lisp symbols from CLHS, along with their "kind":
(mapcar (function first) *kind-to-face-map*) ==>
("Warning" "Variable" "Constant Variable" "Symbol" "System Class"
"Class" "Condition Type" "Type" "Type Specifier" "Declaration"
"Restart" "Special Operator" "Special Form" "Local Macro" "Macro"
"Accessor" "Local Function" "Standard Generic Function" "Function"
"Keyword")
and defined a face for each of these kinds. Then there is code that
generate the font-lock-keywords for all CL symbols.
There remains two problems: some symbols are used for different things
in different contexts (eg. a type and a function). My font-lock code
does not analyses the the syntactic context. And it's rather slow (but
usable!).
One lesson is that it would be really very useful for CL tool builders
to have the CLHS under the form of processable "meta data". One could
easily generate all the lisp-indent-function attributes for all CL
functions and macros, or we could automatically generate any
indentation (or other source analysis) function.
--
__Pascal Bourguignon__ http://www.informatimago.com/
Voting Democrat or Republican is like choosing a cabin in the Titanic.
More information about the slime-devel
mailing list