From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Okamsn Newsgroups: gmane.emacs.help Subject: A more specific/targeted version of macroexpand-all? Date: Thu, 09 Jun 2022 01:31:10 +0000 Message-ID: <2515e8cf-c3cd-2322-2acd-f7e8144b95c2@protonmail.com> Reply-To: Okamsn Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39148"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 09 03:32:13 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nz71w-0009ym-DM for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 09 Jun 2022 03:32:12 +0200 Original-Received: from localhost ([::1]:33630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nz71v-0008Fx-6F for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Jun 2022 21:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nz71L-0008F9-D3 for help-gnu-emacs@gnu.org; Wed, 08 Jun 2022 21:31:35 -0400 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]:39334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nz715-00079P-TX for help-gnu-emacs@gnu.org; Wed, 08 Jun 2022 21:31:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1654738276; x=1654997476; bh=YDK5hddN3Va08khoqngFrQcTJdzjpqqvWuxeJm+1W+E=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=e1uHo38ygcHTSoSRHNmP8w2FsaCnMyk4qEvolH4DcAT1DhXOh1iuOb7aGFCt6xzI9 k8dXrwGSgYN4BR6sX5OXMfsesIwCdqzcgN56DgPs1G+i9ERu/U8qdlnCHJwIfqjIXx 8PuW/9QBOTZl8Z04FaK/lHPdTKXCm1cxbNdWmqk8esdt+49eOONS5q0SrSPwgAn4Fv 7Fom6wdzJmlZ4dCg6OQkSLl0oO49The+c70ifq0U2nkiUQei45kN0N06KkiFEaEzko V+YX60sYYj+7KMvy+yNR6blib/ECxH446C0Q684xyVudS06U/zGCpqmx43l5GH1kot 5UpwO3CXy6MXQ== Feedback-ID: 25935600:user:proton Received-SPF: pass client-ip=185.70.40.133; envelope-from=okamsn@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137534 Archived-At: 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.