On Mon, Jun 04, 2007 at 10:10:06AM +0200, Tobias C. Rittweiler wrote:
Jeronimo Pellegrini j_p@aleph0.info writes:
I have noticed that when I define my own macros and functions, SLIME knows their syntax. If I do:
(my-function-name
SLIME will show the syntax at the minibuffer.
(For the record: that is when SLIME-AUTODOC-MODE is T.)
Ah, yes. I did add that to my .emacs...
Syntax highlighting is called `font-lock' (or fontifying) in Emacs; and fontifying is defined by Emacs, and as such completely orthogonal to Slime. Look at the end of the file `font-lock.el' (or .el.gz) within your Emacs distribution. (Especially `lisp-font-lock-keywords-2'.)
Ok... So SLIME doesn't interact with that in any way, I guess?
In general, only standard macros and special forms are highlighted specially. I've got the following in my ~/.emacs, however:
(font-lock-add-keywords 'lisp-mode '(("(\(\(define-\|do-\|with-\)\(\s_\|\w\)*\)" 1 font-lock-keyword-face)))
So all symbols beginning with `define-', `do-', or `with-' are highlighted specially. (As these should denote macros.)
This is great! I'm using it now, and it already helps with some symbols that I define which start with "do-".
But I was thinking that maybe SLIME could dynamically add keywords to be highlighted?
Like, whenever SLIME saw a (defmacro foo ...), it would add "foo" to the keyword list? That would be wonderful!
Thanks! J.