From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations Date: Mon, 26 Feb 2018 12:32:27 -0500 Message-ID: <9fd6253e-f7c5-8a19-d4c0-771d862bfaab@gmail.com> References: <08190786-14de-a899-f591-a7043c87bebb@gmail.com> <9dbc26f4-e86f-c3df-8193-61a0a3837466@gmail.com> <10414fb8-e09c-a4fa-dcd1-5ccfff10650d@gmail.com> <555f3f1b-d31f-ec12-e460-8b0c20816d45@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1519666289 3077 195.159.176.226 (26 Feb 2018 17:31:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2018 17:31:29 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 26 18:31:25 2018 Return-path: Envelope-to: ged-emacs-devel@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 1eqMcW-0000TF-Nd for ged-emacs-devel@m.gmane.org; Mon, 26 Feb 2018 18:31:24 +0100 Original-Received: from localhost ([::1]:60553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMeZ-0000cn-97 for ged-emacs-devel@m.gmane.org; Mon, 26 Feb 2018 12:33:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMdd-0000bg-Ti for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:32:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqMda-0007uO-BS for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:32:33 -0500 Original-Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]:54129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqMda-0007u0-56 for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:32:30 -0500 Original-Received: by mail-it0-x235.google.com with SMTP id w63so11700615ita.3 for ; Mon, 26 Feb 2018 09:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XJ+6fD/dgv3UVQepV4vmMgJq44iNjxHvAzGtiZz0jL4=; b=vWnc5+sgJdk7f7OwiHc0QXuo/7S8CYI2/XeFhnCYiH0Oq2X0KVKQAHkSdYA8COOzfm nn0ezGzgeenshDmxlGSbeYLPLUUf7gcaD7P1n5cnCN1VSocuZ++Zlag+iUcBItjlAs3H hX6C4MhHyG2CwCk8ikTOCYBxz1zVEw0JPYGwJEmOh0u3amEnbX+sz7hbJgn4UvxuwAn9 /63woR/IB/XNIFxmcGFaxvTm8xC5LWu9Q3P1CC09rq4oHfW+fi9BPUSdN2wHjpjieQKA WRnT/jVX/bz6vIfmUm4J9bcSsGhpa/ioHCM2THFsH6qUJ0oaZM04BZpSNiEepoGH0fZ1 1T7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XJ+6fD/dgv3UVQepV4vmMgJq44iNjxHvAzGtiZz0jL4=; b=h/NlmTbbk+a50oxjEMq8QGMHWKgKl/is6m4UjsqNFm68jz71sHjEj745zpwKo6RdqF YqESiWJ9B+5z7x2eEt4hb3XRYfL2OHp7D3lkRqJAMSS/f6kFlYqEX1L18mHwGRd748u2 kQ/JIlmQDJAKdCawaywFW8oGVwJb0XLd+uo1xRlbCgp+1jtMqKcCi7TE7G18LabvrhSE FZHbIbXYftY0X/nwMI/PoLHLMnW3CqCU/TqUvz0B+C7hOxAgDw34T/WMINjTk3/gZwXC yPuXYdkYG6yzOC+aCQE4C6LN09RDtWpNpyRHTyJHElTMEHmaOgpJeYzzP9PJzYAtkgfq cuLg== X-Gm-Message-State: APf1xPCZ4mzo6/m5bnURZ0oOzK+41JK1vZvEs9+IbqkuVrCC56i3RWny 8M3KrztSU6bovP4UTLCVg2u+Achd X-Google-Smtp-Source: AG47ELtZftl9uzXk0ixqAg31MQazDa+6AQO+Ve978lhMHG6OElPI3mVU2I6l3iDxPI9VC6XnKUaOzA== X-Received: by 10.36.46.22 with SMTP id i22mr4728228ita.59.1519666349417; Mon, 26 Feb 2018 09:32:29 -0800 (PST) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id z1sm5580051itg.37.2018.02.26.09.32.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 09:32:28 -0800 (PST) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223076 Archived-At: On 2018-02-26 12:13, Stefan Monnier wrote: >> My user's problem is the following: Flycheck defines a macro that lets >> you define a new checker. One of our users wrote something like this: >> >> (with-eval-after-load 'flycheck >> (flycheck-define-checker >> …)) >> >> This doesn't work. I claim that it should, or that it should be >> documented to not work. Do you disagree? > > I think it is or should be documented, indeed, but not in > `with-eval-after-load` since this applies to everything else as well. Got it. > If you need to use a macro that's in file `foo`, then AFAIK you have > 2 options: > > - (require 'foo), either directly or transitively. > - hide your macro call behind a quote so it can't be compiled before > `foo` is loaded (regardless of whether you do compile or not > irrelevant: the right way to think about it is "what happens when it > gets compiled"). Thanks, that makes sense. My claim is that there could (should?) be a third option: hide the macro call in a with-eval-after-load block, and that your second point should cover eval-after-load: I find it especially confusing that eval-after-load bypasses the quote.