[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: survey: indentation declaration style
From: |
Andreas Rottmann |
Subject: |
Re: survey: indentation declaration style |
Date: |
Mon, 11 May 2009 14:30:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) |
Thien-Thi Nguyen <address@hidden> 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