From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs-26: `with-eval-after-load' docstring omission Date: Tue, 27 Feb 2018 15:58:05 -0500 Message-ID: References: <827ed6de-fd90-144e-53dd-50163a937b63@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 1519765169 29454 195.159.176.226 (27 Feb 2018 20:59:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2018 20:59:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 27 21:59: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 1eqmLM-0006pz-QV for ged-emacs-devel@m.gmane.org; Tue, 27 Feb 2018 21:59:24 +0100 Original-Received: from localhost ([::1]:40106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqmNN-0007A8-Ra for ged-emacs-devel@m.gmane.org; Tue, 27 Feb 2018 16:01:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqmKM-0004wS-5q for emacs-devel@gnu.org; Tue, 27 Feb 2018 15:58:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqmKH-0005su-9o for emacs-devel@gnu.org; Tue, 27 Feb 2018 15:58:22 -0500 Original-Received: from [195.159.176.226] (port=51088 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqmKH-0005rS-21 for emacs-devel@gnu.org; Tue, 27 Feb 2018 15:58:17 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eqmI9-00072a-Ja for emacs-devel@gnu.org; Tue, 27 Feb 2018 21:56:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:0dUYFDswpp/VEqGC1dGiyER7XEI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:223140 Archived-At: >> Isn't that an irrelevant implementation detail? I don't see why it >> should be documented. > It is relevant, because the behavior isn't the same as 'eval'-ing > a quoted form. Yes, the behavior would be different if we quoted the expression and passed it to `eval`, but in both cases it's an internal implementation detail, and the relevant difference is the resulting change in the semantics. > But I don't think the documentation should be fixed; instead, I think the > behavior should be changed :) I think you're blinded by your current problem. Try and remember the world of Coq. Think about equivalences like (defun FUN () EXP) (with-eval-after-load FILE (FUN)) = (with-eval-after-load FILE EXP) which are currently true (to the extent such things can be true in Elisp where FUN can be redefined, of course) whereas (defun FUN () EXP) (eval-after-load FILE '(FUN)) ≠ (eval-after-load FILE 'EXP) [ Well, of course, this equivalence is actually true as well given the current compiler-macro, but I'm assuming above that we undo this compiler macro. ] IOW, the behavior you seem to want is semantically a good bit more messy. In your case, you do want the quote because you need to delay macro-expansion, but I think it's cleaner to solve this problem by *explicitly* using a quote, rather than by relying on the messy semantics of the macro/function you happen to be using. E.g. your exact same problem could show up if you used, say, (add-hook 'flycheck-mode-hook ...) instead of (with-eval-after-load ...) but you wouldn't ask for a change in add-hook to "solve" your problem. Stefan