From: Peter V. E. <pva...@de...> - 2000-12-15 14:56:11
|
On Thu, Dec 14, 2000 at 03:16:39PM -0800, Dave Morse wrote: > Does anyone know how to educate lisp-mode so its smarter about > indentation? Stuff like the indentation of with-output-to-string is > driving me crazy: > > (defun lookup-c-value (string) > (let (out-string) > (setf out-string > (with-output-to-string (out) > (system *lookup-c-value-program* > :args (list string) > :input (make-string-input-stream string) > :output out))))) I think Macro once posted this: (add-hook 'lisp-mode-hook (lambda () (setq lisp-indent-function 'common-lisp-indent-function))) (defun cl-indent (sym indent) (put sym 'common-lisp-indent-function (if (symbolp indent) (get indent 'common-lisp-indent-function) indent))) (cl-indent 'if '0) (cl-indent 'with-alien '1) (cl-indent 'with-output-to-string '(4 2)) (cl-indent 'pprint-logical-block '(4 2)) (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))) Groetjes, Peter -- It's logic Jim, but not as we know it. | pva...@de... "God, root, what is difference?" - Pitr| "God is more forgiving." - Dave Aronson| http://cvs2.cons.org/~pvaneynd/ |