guile macro indentation in emacs

Viewed 351

Is there something like (declare (indent defun)) for guile so indentation of user-defined macros works like defines?

For example, if I write the following macro,

(define-syntax my-when
  (syntax-rules ()
    ((my-when condition exp ...)
     (if condition
         (begin exp ...)))))

Then, I get indentation that looks like,

(my-when #t
         (write "hi"))

But would prefer the following

(my-when #t
  (write "hi"))

In elisp, I could get the desired indentation via

(defmacro my-when (condition &rest body)
  (declare (indent defun))
  `(if ,condition
       ,@body))

(my-when t
  (message "hi"))

Version/mode notes: emacs 26, scheme-mode w/ geiser, geiser-impl--implementation = guile

1 Answers
Related