guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

survey: indentation declaration style


From: Thien-Thi Nguyen
Subject: survey: indentation declaration style
Date: Mon, 11 May 2009 11:48:28 +0200

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?

thi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]