From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: Calling macro by name while defining another macro Date: Thu, 22 Mar 2018 16:12:42 +0100 Message-ID: <87in9om9ed.fsf@gmail.com> References: <87vadpgiu9.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1521731600 17968 195.159.176.226 (22 Mar 2018 15:13:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2018 15:13:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 22 16:13:16 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ez1tv-0004To-CI for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Mar 2018 16:13:11 +0100 Original-Received: from localhost ([::1]:33096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez1vy-000254-L6 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Mar 2018 11:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez1tZ-0000Vj-Vz for help-gnu-emacs@gnu.org; Thu, 22 Mar 2018 11:12:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ez1tW-00012i-RA for help-gnu-emacs@gnu.org; Thu, 22 Mar 2018 11:12:49 -0400 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:54523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ez1tW-00012H-KX for help-gnu-emacs@gnu.org; Thu, 22 Mar 2018 11:12:46 -0400 Original-Received: by mail-wm0-x22d.google.com with SMTP id h76so16669346wme.4 for ; Thu, 22 Mar 2018 08:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version; bh=x0icJMZBP+AXnXg8ISpQvqVpK/ToC3C0M37mqryNO9I=; b=kxPCoJvmAktC/2sxvDlGU7Xi3lVAzDB1zx895xcjD4l8JXlYbphtfxNo/iQgJJrTLt Qal4XO51kai0wJUyMbAiW0kzwH6JdcOmh9+wBatThRSo7O71cgiZHO9OJgQ/j+lIBDhu wETwtt0FXDZBM/1YYsPWiXO+xyuNkm20L/T6dQE+39xWYF/VMNQHKPBCQIo0Sa57wdKK 1I3/TP6GiJrfJIEJ4CH7WEKyJI5MPkelERbvSrbx1QhHO/TlQRPKZNm5foegFX0oiZup +xKzArIblogJSjR/B9trcnpM8hJZ58O4eLcGm/X/KCZ2a2Sm9z/jo/E7C0V1dZjVZV5c p30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=x0icJMZBP+AXnXg8ISpQvqVpK/ToC3C0M37mqryNO9I=; b=co4Ezkn4rA+3iKj1uYtx6NZOykvdX2ogwvTFLxvqAU/OQoNfNBhIZ1Ve8IuiXkcTqH lTbD5BtE12k5DD11gtzrhQ6ix8BOJVL+INmStMIc+ZEVImSSFap47pPaY9KmGiqmEzgC moF8b2VjKHMsn4Rw7cLiLgkMlH+/8wYD+dfPpUX+OWpZUSBw4UyxCAp+cK/ySCl7jJyl 3Jhjjht2OuqgIPjdFheB9Vbm682WGH6h0SEebuZkr3JuwXFe4Zw023Xjd1DsHKB9blPc w7ri033MpcbE5wsg/Mi6UxvjNO6ebdyULFDOwZCdQ9m6suBIREHPW/1Mze2BhCfw7roS 6XAg== X-Gm-Message-State: AElRT7EwQFBNtUld+2Y63C3pwgyIpjen3NlBVRAah331k7JwEDAn7AD+ ZcZKLSUMikPqMxIx3UoM6fJnF26s X-Google-Smtp-Source: AG47ELtB92jR3MxgVFNxRhYah/L/OXf4d210nM9WzMPEytlsFS9mg+B49FFlnalJ4pvi4lSgaKXBzg== X-Received: by 10.28.214.199 with SMTP id n190mr5894958wmg.16.1521731565173; Thu, 22 Mar 2018 08:12:45 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id e74sm6804261wmg.27.2018.03.22.08.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 08:12:44 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Stefan Monnier's message of "Thu, 22 Mar 2018 09:53:34 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116263 Archived-At: Stefan Monnier writes: >> 1. define macro using `C-x (' >> 2. finish the macro `C-x )' >> 3. name the macro `some-macro' using `name-last-kbd-macro' >> 4. define another macro using `C-x (' >> 5. call `some-macro' using `M-x some-macro' (some-macro called once) >> 6. finish macro editing using `C-x )' >> 7. call the macro again using `C-x e' (effects of `some-macro' are >> applied twice) > > Sounds like a bug. How so? The macro is faithfully recording all the keystrokes, which is both literally 'M-x some-macro' and the keystrokes output by running that macro. As a workaround, you could edit the second macro after defining it to remove the bits you don't want, but that does go against the ease-of-use intent of macros. Robert