Re: small indentation inside with-html from spinneret (Common Lisp)

Peter Münster <[email protected]> Sun, 07 Jun 2026 08:29:28 +0200
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
On Mon, Jun 01 2026, Peter Münster wrote:

> I’m trying to get such an indentation inside the with-html macro:
>
> (with-html
>   (:div.name1 test
>    (:div.name2 test
>     (:div.name3 test
>      (:div.name4 test
>       (:div.name5 test))))))
>
> I’ve tried things like
>
> (put 'with-html 'common-lisp-indent-function
>      '((&whole 2 (&whole 2 (&whole 2 (&whole 2 (&whole 2 &rest 1) &rest 1)
>                                    &rest 1) &rest 1) &rest 1)))

claude.ai suggests this:
--8<---------------cut here---------------start------------->8---
(defun my-with-clog-create-indent (path state indent-point sexp-column normal-indent)
  "Indent forms inside with-clog-create with 2 spaces at every level."
  (save-excursion
    (goto-char (elt state 1))
    (+ (current-column) 2)))

(put 'with-clog-create 'common-lisp-indent-function #'my-with-clog-create-indent)
--8<---------------cut here---------------end--------------->8---

This is my test case:
--8<---------------cut here---------------start------------->8---
(with-clog-create body
  (gui-menu-bar ()
    (gui-menu-drop-down (...)
      (gui-menu-item (...)
		     (gui-menu-drop-down (...)
					 (gui-menu-item (...))
					 (gui-menu-item (...)))))))
--8<---------------cut here---------------end--------------->8---

So it works for 3 levels. Why not for more?

I just would like to have "(setq lisp-indent-offset 2)" inside
with-clog-create and with-html.

TIA for any hints,
-- 
           Peter