Can someone show me what's necessary to get font-lock-mode working at
maximum effectiveness under acl 4.3.1's emacs interface? Right now, only
comments are in a different color font. Is it possible to get other things,
eg special forms, built-in functions and macros, to appear in a different
color font?
This is my .emacs file at present (any other comments on this file are
welcome).
(setq load-path (cons "/usr/local/acl4.3/home/emacs/eli-2.0.21.pre-beta.15"
load-path))
(load "fi-site-init.el")
(load "font-lock.el")
(setq fi:lisp-mode-hook
'(lambda ()
(font-lock-mode)))
(setq fi:inferior-common-lisp-mode-hook
'(lambda ()
(font-lock-mode)))
(setq fi:subprocess-mode-hook
'(lambda ()
(font-lock-mode)))
(setq emacs-lisp-mode-hook
'(lambda ()
(font-lock-mode)))
(setq c-mode-hook
'(lambda ()
(font-lock-mode)))
(setq
font-lock-auto-fontify t
font-lock-maximum-decoration t)
(setq fi:common-lisp-buffer-name "*mycl*")
(setq fi:common-lisp-directory "/export/home/bruce")
(setq fi:common-lisp-image-name "/usr/local/bin/acl")
(setq fi:common-lisp-image-arguments nil)
(defun mycl ()
"This function starts up lisp with my defaults."
(fi:common-lisp fi:common-lisp-buffer-name
fi:common-lisp-directory
fi:common-lisp-image-name
fi:common-lisp-image-arguments
fi:common-lisp-host))
(mycl)
--
Bruce Lambert, PhD
Department of Pharmacy Administration
University of Illinois at Chicago
833 S. Wood St. (M/C 871)
Chicago, IL 60612-7231
Ph: (312) 996-2411
Fax: (312) 996-0868
"Bruce L. Lambert" <········@uic.edu> writes:
< Can someone show me what's necessary to get font-lock-mode working at
< maximum effectiveness under acl 4.3.1's emacs interface? Right now, only
< comments are in a different color font. Is it possible to get other things,
< eg special forms, built-in functions and macros, to appear in a different
< color font?
Maybe.
< This is my .emacs file at present (any other comments on this file are
< welcome).
<
< (setq load-path (cons "/usr/local/acl4.3/home/emacs/eli-2.0.21.pre-beta.15"
< load-path))
< (load "fi-site-init.el")
< (load "font-lock.el")
<
< (setq fi:lisp-mode-hook
< '(lambda ()
< (font-lock-mode)))
It's best not to quote lambda forms in emacs - I think it prevents the
byte compiler from inlining the parameters. Not too important here
though.
You should know that I became very frustrated with font-lock quite
some time ago and this is part of the result. I think the problem is
due to the fact that emacs is dumped with an enormous amount of
assumptions enabled. This seems to be a re-occurring problem.
In anycase, I think this may be helpful, but I forget exactly what I
did to fix it permenatly (ispell is a really cool program. It's a
program designed to tell you when a word is mispelled - doesn't have a
fucking clue as to what is wrong with the word - just does a quick
hash-table lookup and sees that the word isn't there. Pretty good idea
I think. Sounds like what?)
(require 'font-lock)
(eval-when (compile load execute)
(load-library "lazy-lock")
(load-library "font-lock"))
;; You can use this to enable font lock for all modes by default
(global-font-lock-mode t)
(setq search-highlight t
font-lock-support-mode 'lazy-lock-mode
face-default-stipple "Stipple"
lazy-lock-defer-on-scrolling t
lazy-lock-defer-on-the-fly t
lazy-lock-minimum-size (* 1024 1024 10)
font-lock-maximum-decoration t)
(setq lisp-font-lock-keywords 'lisp-font-lock-keywords-2)
(let ((res (assq 'fi:common-lisp-mode font-lock-defaults-alist)))
(rplacd res '(lisp-font-lock-keywords-2
nil nil (("+-*/.<>=!?$%_&~^:" . "w"))
beginning-of-defun
(font-lock-comment-start-regexp . ";")
(font-lock-mark-block-function . mark-defun))))
I think this may help. Try typing M-x normal-mode a couple times. I
think this is set automatically in the fi:common-lisp-mode-hook, but I
remeber having problems with it. Don't rember exactly what I did to
fix it though.
I'm in such a bad mood - hope this was helpful though.
ARG! Ispell is in my modeline and won't go away. Damn I hate that
program...
(mapc #'delete-process (process-list)) ... Ha, as if.
(save-window-excursion
(select-window (minibuffer-window))
(delete-region (point-min) (point-max)))
Just one of them days I guess... Have fun...
I get reasonable results with the following setup
The file is an extra one which eventually load (don't ask me to post
my whole emacs setup: it's very hairy)
The main problem with Emacs is that there are no good setups for
Common Lisp. And those that are there are old and very hard to fix. I
(sort of) maintain ILISP with Rick Campbell (and Erik's who handles
the mailing list) and have burnt myself quite a few times before real work
caught up with me and mede me stop hacking Elisp code.
An example is the c-indent code. I still have not figured out (I might
be strupid - fine!) how to properly define an indentation pattern for
(defmethod zut :before ((x t) &rest agrs)
(do-something x))
If anybody wants to takle LOOP, s/he is welcome :)
Anyway, find attached the font-lock I use for Common Lisp. And since I am
at it, let it be known that I also use the following (not quite the
real thing, but a good approximation to post).
==============================================================================
;;; -*- Mode Emacs-Lisp.el -*-
(require 'cl)
(defun cltl-mode ()
"Major mode for editing Common Lisp code.
Commands:
Delete converts tabs to spaces as it moves back.
Blank lines separate paragraphs. Semicolons start comments.
\\{lisp-mode-map}
Note that `run-lisp' may be used either to start an inferior Lisp job
or to switch back to an existing one.
Entry to this mode calls (in order) the values of `lisp-mode-hook' and
`cltl-mode-hook' if they are non-nil.
If the ILISP package is not loaded this should end the documentation
string."
(interactive)
(lisp-mode)
(setq mode-name "Common-Lisp")
(setq lisp-indent-function 'common-lisp-indent-function)
(run-hooks 'cltl-mode-hook))
;;; Assuming font-lock is loaded.
(add-hook 'cltl-mode-hook 'turn-on-font-lock)
;;; end of file -*- cltl-mode.el -*-
==============================================================================
==============================================================================
;;; -*- Mode: Emacs-Lisp -*-
;;; font-lock-cltl-mode.el --
;;; Extra highlighting for Common Lisp.
;;; Note: should change 'LISP-MODE with 'CLTL-MODE
(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 --
==============================================================================
Cheers
--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - (0)6 - 68 10 03 17, fax. +39 - (0)6 - 68 80 79 26
http://www.parades.rm.cnr.it