From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#46958: 28.0.50; invalid-function error for macros that have function bindings Date: Mon, 8 Mar 2021 22:06:31 +1300 Message-ID: References: <87pn0co316.fsf@gnus.org> <87h7louzqp.fsf@tcd.ie> <2f63faf5-656a-e9cd-2249-0576da0b9e0c@orcon.net.nz> <2406e008-05f0-f95f-cc95-72f873bc12b8@orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28151"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: "Basil L. Contovounesios" , Lars Ingebrigtsen , 46958@debbugs.gnu.org To: Robert Irelan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 08 10:07:09 2021 Return-path: Envelope-to: geb-bug-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 1lJBr3-0007D4-GT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Mar 2021 10:07:09 +0100 Original-Received: from localhost ([::1]:59358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJBr2-0002dm-1B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Mar 2021 04:07:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJBqw-0002de-OV for bug-gnu-emacs@gnu.org; Mon, 08 Mar 2021 04:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJBqw-0001s7-HL for bug-gnu-emacs@gnu.org; Mon, 08 Mar 2021 04:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lJBqw-0001Np-BU for bug-gnu-emacs@gnu.org; Mon, 08 Mar 2021 04:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Mar 2021 09:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46958 X-GNU-PR-Package: emacs Original-Received: via spool by 46958-submit@debbugs.gnu.org id=B46958.16151943985280 (code B ref 46958); Mon, 08 Mar 2021 09:07:02 +0000 Original-Received: (at 46958) by debbugs.gnu.org; 8 Mar 2021 09:06:38 +0000 Original-Received: from localhost ([127.0.0.1]:42113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJBqY-0001N6-2B for submit@debbugs.gnu.org; Mon, 08 Mar 2021 04:06:38 -0500 Original-Received: from smtp-4.orcon.net.nz ([60.234.4.59]:36633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJBqU-0001Mw-Dg for 46958@debbugs.gnu.org; Mon, 08 Mar 2021 04:06:36 -0500 Original-Received: from [101.53.216.162] (port=10767 helo=[192.168.20.103]) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1lJBqR-0007CN-T5; Mon, 08 Mar 2021 22:06:32 +1300 In-Reply-To: Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201816 Archived-At: On 8/03/21 8:18 pm, Robert Irelan wrote: > I extracted the macros into a separate library `org-fc-macs` and then > called `(require 'org-fc-macs)` from the file where the error is > occurring `org-fc-type-normal.el`. This seems to have fixed the issue. Good to hear. I'll just add that my suggestion wasn't quite optimal -- as this is a macros-only library, a better way to require it is: (eval-when-compile (require 'org-fc-macs)) This ensures that macros are loaded for byte-compilation, but means that subsequently loading the byte-compiled .elc library does *not* load org-fc-macs (which is not needed in this scenario as, in the byte-compiled code, the macro calls have already been expanded). -Phil