I just started using Allegro CL under Linux. And I'm using the fi Emacs
interface. And I don't like the default indentation style.
1. Does anybody know how to change the default so that it indents 1 space
under a defun, let, or dotimes. I.e. by default, it gives me:
(defun foo ()
(let ()
(dotimes (i n)
(setf j 0))))
and I prefer:
(defun foo ()
(let ()
(dotimes (i n)
(setf j 0))))
This used to be done by the variable lisp-body-indent in the default Lisp
mode that is used before fi is loaded. What is the equvalent in fi?
2. I used to change the default indentation of numerous special forms with
(put '<special-form> 'lisp-indent-function <n>) in the default Lisp mode.
What is the equivalent in fi?
Thanks,
Jeff (http://www.neci.nj.nec.com/homepages/qobi)
P.S. please email your response as well since our newsfeed is unreliable
-------------------------------------------------------------------------------
;;; Changed lisp-indent-hook to lisp-indent-function for emacs-19.
;;; Decrease the default indentation for function bodies.
(setq lisp-body-indent 1)
;;; Change the indentation of some forms
(put 'etypecase 'lisp-indent-function 1)
(put 'ecase 'lisp-indent-function 1)
(put 'if 'lisp-indent-function nil)
(put 'multiple-value-bind 'lisp-indent-function 2)
(put 'multiple-value-setq 'lisp-indent-function 2)
(put 'unwind-protect 'lisp-indent-function 1)
(put 'with-open-file 'lisp-indent-function 1)
(put 'dotimes 'lisp-indent-function 1)
(put 'idotimes 'lisp-indent-function 1)
(put 'dolist 'lisp-indent-function 1)
(put 'loop 'lisp-indent-function 0)
(put 'eval-when 'lisp-indent-function 1)
(put 'when 'lisp-indent-function 1)
(put 'unless 'lisp-indent-function 1)
(put 'case 'lisp-indent-function 1)
(put 'typecase 'lisp-indent-function 1)
(put 'block 'lisp-indent-function 1)
(put 'catch 'lisp-indent-function 2)
(put 'defflavor 'lisp-indent-function 3)
(put 'defmethod 'lisp-indent-function 2)
(put 'defun 'lisp-indent-function 2)
(put 'destructuring-bind 'lisp-indent-function 2)
(put 'lambda 'lisp-indent-function 1)
(put 'cl:etypecase 'lisp-indent-function 1)
(put 'cl:ecase 'lisp-indent-function 1)
(put 'cl:if 'lisp-indent-function nil)
(put 'cl:multiple-value-bind 'lisp-indent-function 2)
(put 'cl:multiple-value-setq 'lisp-indent-function 2)
(put 'cl:unwind-protect 'lisp-indent-function 1)
(put 'cl:with-open-file 'lisp-indent-function 1)
(put 'cl:dotimes 'lisp-indent-function 1)
(put 'cl:dolist 'lisp-indent-function 1)
(put 'cl:loop 'lisp-indent-function 0)
(put 'cl:eval-when 'lisp-indent-function 1)
(put 'cl:when 'lisp-indent-function 1)
(put 'cl:unless 'lisp-indent-function 1)
(put 'cl:case 'lisp-indent-function 1)
(put 'cl:typecase 'lisp-indent-function 1)
(put 'cl:block 'lisp-indent-function 1)
(put 'cl:catch 'lisp-indent-function 2)
(put 'cl:defflavor 'lisp-indent-function 3)
(put 'cl:defmethod 'lisp-indent-function 2)
(put 'cl:defun 'lisp-indent-function 2)
(put 'cl:destructuring-bind 'lisp-indent-function 2)
(put 'cl:lambda 'lisp-indent-function 1)
;;; For CLX
(put 'event-case 'lisp-indent-function 1)
(put 'xlib:event-case 'lisp-indent-function 1)
;;; For CLIM
(put 'with-output-to-string 'lisp-indent-function 1)
(put 'with-input-from-string 'lisp-indent-function 1)
(put 'with-output-to-postscript-stream 'lisp-indent-function 1)
(put 'with-command-table-keystrokes 'lisp-indent-function 1)
(put 'with-bounding-box 'lisp-indent-function 1)
(put 'with-room-for-graphics 'lisp-indent-function 1)