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: emacs-26: `with-eval-after-load' docstring omission Date: Fri, 13 Apr 2018 12:00:41 -0400 Message-ID: <35b3a8a6-6cf1-bb0b-c0b6-e8e25fa803fc@gmail.com> References: <827ed6de-fd90-144e-53dd-50163a937b63@gmail.com> <4e07d7b4-f1f7-0d5d-5f2a-b5e491ab4303@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 1523635217 29899 195.159.176.226 (13 Apr 2018 16:00:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2018 16:00:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 13 18:00:13 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 1f717V-0007ej-0C for ged-emacs-devel@m.gmane.org; Fri, 13 Apr 2018 18:00:13 +0200 Original-Received: from localhost ([::1]:35103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f719b-0005U7-5j for ged-emacs-devel@m.gmane.org; Fri, 13 Apr 2018 12:02:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7184-0004RF-Gf for emacs-devel@gnu.org; Fri, 13 Apr 2018 12:00:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7180-0008AX-Ib for emacs-devel@gnu.org; Fri, 13 Apr 2018 12:00:48 -0400 Original-Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:43638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7180-00089k-Dx for emacs-devel@gnu.org; Fri, 13 Apr 2018 12:00:44 -0400 Original-Received: by mail-qt0-x231.google.com with SMTP id s48so8514003qtb.10 for ; Fri, 13 Apr 2018 09:00:44 -0700 (PDT) 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=57wiJdGj/s6uwnazAm96poq5V7m8qxhtfcsc73nBEj0=; b=XF9zM62g1x3+0CZn+NvO9lAVWNnELnw2sAr8puBNaI8ywD8Y7EHXf/8XLWHDESlp+D 8P3szo62MbENqWQe8Ox1t/HSeKFYEKPaZF4zF/giZ4CZvFS6cmw4iOn3u7C3icVmVtpq UyOsKtaM5Gx0FFDRAW+yc/r1zjJyVW62kLIYt6HxRgR3t/WjLa9ZFx7ByKaTmKeHTm8h nVts5uw80A8EqTiL1/BLVtYils+c5XzUCU0iF/ZCrKLgOz21821vphJLIvHatqa3LLjD QvWcGD2qmjpx9lVsCK+l0JL01IhkVjSe8e8T0XWsiyN7FWV7ObjmBUYRI3bdN9gFL4JU hQiQ== 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=57wiJdGj/s6uwnazAm96poq5V7m8qxhtfcsc73nBEj0=; b=T12X4xp7G3gL1dELpgp7TBz83mT08uId5Om1xctyC3yTsISQACKgqDZuzriGQ7FOn8 1GQ/hk7EiCcSkPMYecCrHs+erNeNkvpiAvsfRT1u9dKYk90IuPkGSIgHULzB7o7VxTTm ninQsi2X03QI9P9d64n+huFE0u8TxeMVRsCcRA3ai5P435H6aC9XerDcvhv0Ok3GW6uj Ah5cn+WfJLgscWl9JAdgSm+S6WNLRVOIAmKL4KiGHTh1dS2eUvfzkMVXhlqH/mjuO/MD AHlHwMkITjcC3eWiZfDwsNfvfBK13AdJbz/pEz21JWUl3Ig4H4VSUJp1tYh7Z7/HN76M BHCA== X-Gm-Message-State: ALQs6tD4r83/xEn1wRD1gppzXffBtShZITOeECLYh7uK9y/qzo1QKyd6 c+BF6nulMr8JMTz+WaKHj5zL18gS X-Google-Smtp-Source: AIpwx497Au7hE/KE6szGghvsz1xlHRX0qNNS/tP2KM3rv3Y39cqfpeddUG+L7Mpbf8NtNLRBBCWCpQ== X-Received: by 10.237.41.101 with SMTP id s92mr1869271qtd.114.1523635243419; Fri, 13 Apr 2018 09:00:43 -0700 (PDT) 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 s16sm5186710qks.78.2018.04.13.09.00.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 09:00:42 -0700 (PDT) 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:400d:c0d::231 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:224548 Archived-At: On 2018-03-17 10:19, Stefan Monnier wrote: > As mentioned before: cleaner semantics. Macro-expanding the body of > with-eval-after-load more lazily (which is the core of the problem > you're hitting) won't help you if you happened to write your code as: > > (defun my-after-flycheck () > (push "npx" (flycheck-checker-get 'javascript-eslint 'command))) > (with-eval-after-load 'flycheck > (my-after-flycheck)) Right. That function should be moved into the with-eval-after-load block :) > I'd suggest to start by trying to find a way to get the behavior you > want *without* relying on (with-)eval-after-load (which is fiddly in any > case for all kinds of reasons. It's a handy tool when you need it, but > if you need it I consider that it's usually a sign that there's > a problem elsewhere). > Of course, this may require changes in flycheck. Sorry for the long delay. I spend some time thinking about this, but I didn't reach a satisfactory conclusion. Flycheck defines a few of macros. Our users want to write code that depends on them in their init files, but don't care for that code to run unless they are in fact using Flycheck. What's the right approach? Couldn't we just define a with-macroexpand-and-eval-after-load macro, and call it a day? Clément.