From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Printing code made by a macro Date: Sat, 5 Aug 2023 21:31:09 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8033"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 06 02:32:04 2023 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 1qSRgh-0001rk-KI for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Aug 2023 02:32:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSRg8-0001wb-6R; Sat, 05 Aug 2023 20:31:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSRg5-0001w6-SD for help-gnu-emacs@gnu.org; Sat, 05 Aug 2023 20:31:25 -0400 Original-Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSRg4-0006tS-8d for help-gnu-emacs@gnu.org; Sat, 05 Aug 2023 20:31:25 -0400 Original-Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-583a8596e2aso32496587b3.1 for ; Sat, 05 Aug 2023 17:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691281882; x=1691886682; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nY2pBjhKjRxrakx98WHhN0lgg7pgn3nLryLw7x5qp6I=; b=b76g3zWJV8Ig0HnUCILvGyj6YXmpIuxEkD08gu84WmH0u5vj+jwZsoimEk05snbddR kNfdj8brRxhJLYpSKru7kLtwdEuHlNSRQp+pt3SctBR8KKjn+ZcfgiL65rHKrVMzaMQb tsquLIC03chgsGw8YJIpgPeQKKplZFw4PtE+paT5I0US9T99Bkq0+PMQOw25q9sMcNfh /jr3fAK5wQ30k43HN15AV0OWE6zQp8/1lISj3xZ8Y0NxWyemvQ/bA9CyHFh/mdbliMej q39afIoG5gtQgnPNun49iaXckuyl2Zn4nt7zPSXTp+eXQ6T/WUdI9BJy2g6j1Lo0WVmW t4JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691281882; x=1691886682; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nY2pBjhKjRxrakx98WHhN0lgg7pgn3nLryLw7x5qp6I=; b=gr7JabGz+hVQwC45LhY+YcgggVr60BFILUOhvnB1GCMG6Sb0ir+eU1iQpi2AVkxV8w TmpTXWFlz2/gUeKgAgdZYGGsJTmC/JyqXoVrGZ8w6yqI23gaNQV3s3VfvC3okJGjPxU5 +j6Nb8ExCMSXuteWl7wwTaVx/YA5Yir0mQyOHZuiIHFMk57ko3Em1P84GNvRJSbRnglp l4wL6zlMib0f41j7Vgssdbu2f5Cd/hJcDn3Zfnxvex9vIONJzxHzr1mDoX4JC0MEYrxT sQke/cg30Z23KhkBR2HWqWdZarzz4Ei2mU2dSBPFRKoWmc4mEASLuH85fP5XxNXwd5l7 5j9g== X-Gm-Message-State: AOJu0Yxg1ukrYPLgDxUaOhWyUmw/pV6FVDzCFSdy4Xu2dhMURLmOmlxL VC+bC5+eePpHN+s1jP5rUdcBTmP1UODUKZPoThM= X-Google-Smtp-Source: AGHT+IGeEPsTg+5FnQDM2EZ3fwaRBtBIcID0JgM6Q8D3OqPTm0HY2xNvVGJnabgimFILHXFdVvlNhvdim7yPQyaGuTQ= X-Received: by 2002:a0d:d796:0:b0:584:6239:8f36 with SMTP id z144-20020a0dd796000000b0058462398f36mr5033923ywd.14.1691281882203; Sat, 05 Aug 2023 17:31:22 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::112f; envelope-from=eduardoochs@gmail.com; helo=mail-yw1-x112f.google.com 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144626 Archived-At: On Sat, 5 Aug 2023 at 20:43, Heime wrote: > > Is there a proper way to display the code produced by a macro ? Perhaps > call > a function to print it by passing the macro command ? > > (print-code (mymacro (* 2 3) (* 5 8) )) > > Which would print (+ 3 8) > > How would one write print-code ? > Hi Heime, eev has a function, called "find-eppm", that takes a sexp, expands it with macro-expand, pretty-prints the expansion, and displays the pretty-printed code in a temporary buffer. If you'd like to try it, install eev, run this, (require 'eev-load) and then type `C-x C-e' after the last parenthesis here: (find-eppm ' (define-minor-mode MAIN-mode "Help 1" :init-value t :global t :lighter (propertize " MAIN" 'face 'region)) ) The reason for the "(require 'eev-load)" is explained here: http://anggtwu.net/eev-intros/find-eev-quick-intro.html#1 http://anggtwu.net/eev-current/eev-load.el.html#autoloads Cheers, Edrx