Thien-Thi Nguyen <t...@gnuvola.org> writes: > I've tentatively adopted the following indentation declaration style. > Non-coincidentally, it resembles that used for Emacs Lisp code. > The #; represents pan-Scheme (R7RS?) wishful thinking. > > (define-macro (forse precond . corpo) > ;;#;(declare (indent 1)) > `(or (and-let* ,precond (list ,@corpo)) > '())) > > Here is Emacs Lisp, suitable for scheme-mode-hook, that recognizes this. > > (defun ttn-scheme-set-macro-indentation () > (save-excursion > (goto-char (point-min)) > (while (re-search-forward > (concat > "^(def\\S-+\\Sw+\\(\\S-+\\)[^\n]+\n" > ;; TODO: parameterize > " ;;#;(declare (indent \\(.\\)") > nil t) > (put (intern (match-string 1)) > 'scheme-indent-function > (string-to-number (match-string 2)))))) > > What do other people do? > I do this:
;; Local Variables: ;; scheme-indent-styles: (trc-testing (test-pn= 1)) ;; End: I have an extended version of the scheme indenting code that understands that; you can specify "indent styles" like this: (scheme-add-indent-style 'trc-testing '((test-eq 1) (test-equal 1) (test-equiv 1) (test-compare 2))) See [0] for the code and some "indent styles" I use. [0] http://github.com/rotty/dotfiles/blob/aaa620b65ef4112ece0d9fd491982768b2d3c93c/.emacs.d/config/scheme.el HTH, Rotty