[GUFSC] .emacs - Common Lisp

Ricardo Grützmacher grutz@terra.com.br
Thu, 18 Jul 2002 16:47:09 -0300


;; Common Lisp indentation.
(load-library "cl-indent")
(add-hook 'lisp-mode-hook 'turn-on-font-lock
   (lambda ()
     (setq lisp-indent-function 'common-lisp-indent-function)
) )

;; Additional definitions by Pierpaolo Bernardi.
(defun cl-indent (sym indent)
   (put sym 'common-lisp-indent-function
     (if (symbolp indent)
       (get indent 'common-lisp-indent-function)
       indent
) ) )
(cl-indent 'if '1)
(cl-indent 'defclass '((&whole 4 &rest (&whole 2 &rest 1))
	               &rest (&whole 2 &rest 1)))
(cl-indent 'defgeneric 'defun)
(cl-indent 'defmethod '(4 4 (&whole 4 &rest 1) &body))
(cl-indent 'generic-flet 'flet)
(cl-indent 'generic-labels 'labels)
(cl-indent 'symbol-macrolet 'multiple-value-bind)
(cl-indent 'with-accessors 'multiple-value-bind)
(cl-indent 'with-added-methods '((1 4 ((&whole 1))) (2 &body)))
(cl-indent 'with-slots 'multiple-value-bind)
(cl-indent 'handler-bind '((&whole 4 &rest 1) 2 &body))
(cl-indent 'handler-case '((1 4) (&whole 2 ((0 1) (1 3) (2 &body)))))
(cl-indent 'define-condition '((1 6)
                                (2 6 ((&whole 1)))
                                (3 4 ((&whole 1)))
	                       (4 &body)))
(cl-indent 'restart-bind '(((&whole 2 (0 1) (&whole 1))) (2 &body)))
(cl-indent 'restart-case '((1 4) (&whole 2 ((0 1) (&whole 1)))))
(cl-indent 'with-condition-restarts '((1 4 ((&whole 1))) (2 &body)))
(cl-indent 'with-simple-restart '((1 4 ((&whole 1))) (2 &body)))
	
;; Visualizing Lisp forms.
(let ((hook
         (lambda ()
	  (setq mode-motion-hook 'mode-motion-highlight-sexp))))
   (add-hook 'emacs-lisp-mode-hook hook t)
   (add-hook 'lisp-interaction-mode-hook hook t)
   (add-hook 'lisp-mode-hook hook t)
   (add-hook 'inferior-lisp-mode-hook hook t)
   (add-hook 'talk-mode-hook hook t)
)