all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A more specific/targeted version of macroexpand-all?
@ 2022-06-09  1:31 Okamsn
  2022-06-09  1:36 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Okamsn @ 2022-06-09  1:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I would like to use `macroexpand-all` to substitute code in-place, like
a macro. My problem is that `macroexpand-all` expands all known macros
in the expression. I only want to use it to expand a limited set of macros.

I have been able to explicitly prevent expansion of macros by including
them in the second argument of `macroexpand-all`, such as in

     (macroexpand-all my-code `((cl-block) (cl-return-from) ,@my-macros))

but that still leaves the possibility of other, unknown macros expanding
incorrectly.

Is there a better way to do this kind of limited expansion than
`macroexpand-all`?

If not, is there a way to be more targeted when using `macroexpand-all`?
For example, is the below code the best way to get the currently known
macros that would be expanded by `macroexpand-all`?

     (cl-loop for i being the symbols
              when (eq 'macro (car-safe (symbol-function i)))
              collect i)

Thank you.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-09 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-09  1:31 A more specific/targeted version of macroexpand-all? Okamsn
2022-06-09  1:36 ` Emanuel Berg
2022-06-09  1:40 ` cl-loop and collect (was: Re: A more specific/targeted version of macroexpand-all?) Emanuel Berg
2022-06-09  1:48   ` Emanuel Berg
2022-06-09 10:47 ` A more specific/targeted version of macroexpand-all? Michael Heerdegen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.