From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: About the usage of `with-eval-after-load'. Date: Sun, 19 Sep 2021 11:41:39 +0800 Message-ID: References: <87wnnetazo.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joost Kremers , "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 19 05:42:21 2021 Return-path: Envelope-to: geh-help-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 1mRnif-0004o1-9A for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 05:42:21 +0200 Original-Received: from localhost ([::1]:43160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRnid-0001ZR-1C for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 23:42:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRniD-0001ZH-0A for help-gnu-emacs@gnu.org; Sat, 18 Sep 2021 23:41:53 -0400 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:33733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRniB-0001bz-J4 for help-gnu-emacs@gnu.org; Sat, 18 Sep 2021 23:41:52 -0400 Original-Received: by mail-qk1-x734.google.com with SMTP id d207so5659780qkg.0 for ; Sat, 18 Sep 2021 20:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O8IbgKBh6mHyMr8zd+YVhEj7rHzv2ZjTEaI9ykqf85g=; b=cnuOjhyWa07w4NwqrNqllEJFvcHoxtI5rfDBadfUPwP+obG/2aGROgKeqhmxkdlfiy 3peff0M0aDkSIOvBPYWrfJkVzoeKp0tm14kva4EihDW4Ztykxs0sEu4wvr8s59W2aQTK woIRDp1cBMzronQ6me/3DZffgeZO2oLsonwPL77CbsLpQx3ryMatpy/Pbyvd2aUy/oaD vrmNEYWVFU/hLHPAbvE6yHLSSqRF4CE4/wjdKtgqsWFUZvapohCoRhMrLRyakX0H4QB5 Oyhng1EqvhQB9YM5sAPTpyAhUZ19IL6wc3Aj1vqMUV+pUQSbXr/+qfzK15r8ffwZ0no/ PyoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O8IbgKBh6mHyMr8zd+YVhEj7rHzv2ZjTEaI9ykqf85g=; b=vvlWEMOQ5MAteI9bVNceH2JNLPgQUv8OCjjDCj29j5cUCHbpuvP400xZMvYV8GN2GN LB64LzpuO7E9gjBXfvMsB/dZm/yPcGPGkPxA2ZAbWYWjflNWxPESrQnpQfqqVytto+BC cN5bsclr+J13EEV0TY+nwYNMtdD0Ewm7JHCwsZ3ApIootztW4oBESKvSQoxRJvuhdetg COGXKcDrSxr9/lnEufmc1k11Fylxj/D1uFDl4JVzIZu5WV4BxdlczqsFrb82Av3Kpu4A goUbtjdLD2gur5hPBOrSeVDZC55wXFeej0Ew+SnN92IOwnU+DN6cbwTgMlghe8R99KT4 rK+w== X-Gm-Message-State: AOAM5318fmBYZyBwtI9U/WCkhkQXWdZ01jI8BVibEP8l5EQvxUz/NhyP +mz6acPX14pWvCZYErAMjp4b/XRppGRJ6xmWyRU= X-Google-Smtp-Source: ABdhPJzQ597Ze+ZWtQyMJ86j8mjHkrW2M0UVh30E32G7aEVZx4y5T5ge+WrPic6sdEIS69WN8chRavnhU/D33p1UlHI= X-Received: by 2002:a25:bdc5:: with SMTP id g5mr22122336ybk.403.1632022910448; Sat, 18 Sep 2021 20:41:50 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=hongyi.zhao@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133096 Archived-At: On Sat, Sep 18, 2021 at 10:56 PM Drew Adams wrote: > > > > Based on the above explanation, it seems that only one FILE can be > > > used, but according to my tries, the following code snippet also take > > > effect: > > > (add-hook 'python-mode-hook 'hs-minor-mode) > > > (with-eval-after-load > > > "python" > > > (progn...) 'elpy (pyvenv-activate...)) > > Joost explained well what's going on. In addition, > just in case it still isn't clear: > > You're using only _one_ FILE arg, "python". The 3 > other args you pass correspond to the &rest arg (aka > &body defmacro arg), BODY. So BODY is the list of > actual args: ((progn...) 'elpy (pyenv-activate...)). > > Before macro `with-eval-after-load' was added, users > sometimes forgot to quote (or otherwise generate) the > second arg to the _function_ `eval-after-load' (and it > is a single arg, FORM, not an &rest list of args BODY). > > That was the main reason `with-*' was introduced: for > convenience because 99% of the time FORM was a quoted > sexp, and sometimes users forgot the quote char. Thank you for your thoughtful further explanation, which makes me feel that the Emacs community is indeed one of the few places in the world where dedicated experts and masters gather. Even though my LISP language level is still fairly rudimentary, I still have the motivation to improve with the help of many mentors in such an environment. BTW, why do you write the title for your post like the following: RE: [External] : Best, HZ