unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: akater <nuclearspace@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: cl-macs: default indentation for all arglists with top-level &body
Date: Sun, 11 Apr 2021 12:23:45 -0400	[thread overview]
Message-ID: <jwvfszwhjyk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87blalt2w9.fsf@gmail.com> (akater's message of "Sun, 11 Apr 2021 12:35:34 +0000")

>   ;; Placing the declaration in the end
>   ;; allows overriding the indentation setting
>   ;; with an explicit (declare (indent ..)) statement
>   ;; manually written in the form being expanded.
>   (setq header
>         (nconc header
>                (list
>                 `(declare (indent ,according-to-&body))))))

I see one "problem" with this: it provides the `indent` but not the
`debug` spec.  Maybe another way to go about it is to try and infer the
`indent` spec from the `debug` spec (since I think it's hopeless to try
and guess the debug spec from the arglist).

> The feature was
> - suggested to be applied to usual ~defmacro~ as well
> - not implemented as there is no ~&body~ in ~defmacro~
> - apparently shelved and then forgotten about
>
> I only suggest to alter ~cl-defmacro~.

It would clearly be a lot more useful to make it work for `defmacro` as
well since the very vast majority of macros are defined with `defmacro`.

> As to whether the macro better inject ~(put ..)~ or ~(declare ..)~ form,
> my preference is for the latter because

FWIW, I think injecting `declare` is cleaner, indeed (but of course it
needs to be careful not to override a pre-existing `declare`).


        Stefan




      reply	other threads:[~2021-04-11 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 12:35 cl-macs: default indentation for all arglists with top-level &body akater
2021-04-11 16:23 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfszwhjyk.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=nuclearspace@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).