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: About the usage of `with-eval-after-load'. Date: Sat, 18 Sep 2021 17:51:09 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36474"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 18 11:52:01 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 1mRX0r-0009Kt-P8 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 11:52:01 +0200 Original-Received: from localhost ([::1]:53608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRX0q-0001tM-Me for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 05:52:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRX0H-0001sz-2L for help-gnu-emacs@gnu.org; Sat, 18 Sep 2021 05:51:25 -0400 Original-Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:33783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRX0F-0003GC-Kd for help-gnu-emacs@gnu.org; Sat, 18 Sep 2021 05:51:24 -0400 Original-Received: by mail-lf1-x131.google.com with SMTP id y28so42640067lfb.0 for ; Sat, 18 Sep 2021 02:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=3cZCYsDVcWOVSCewSdu2W8B1XDH+RAzKRLhmbFbtGa4=; b=qR/Q2ZkFqIIOaa5GAzPRCZE27I0vgEkHPHDSxsNx7MEwInUQRwoj03asJdQQcNjmg5 nKWoWXM7NK7GTe6PM7ocJISLx1CHNm3YhUsL6L9ucbxw+52AEoeiM8LuXiuQ3hDyBAWt n1dO+BJnG020LhmWUgEKekLNR1m78PrO0IocQOCRhv+7FfRZoTQ3IDDWhZ0mnl6hJrep jJjaLf+veF3NYmzCO/6d1/RuJjcZj6Y181O055ioo+WiZxprBDBlvMAWR6e4EKKBCDkD V1OKFL7Q0NfhoGVGd9s6SF0pFYqylQQ2luqWtlNp3CNpbZxhz1tl4ykk4HkbsYSmppxK FZ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=3cZCYsDVcWOVSCewSdu2W8B1XDH+RAzKRLhmbFbtGa4=; b=5Uk8tXZWAWfxNfIWw3v+vTu9sY8+FoLdlj8CFNaLOm2pCSkMFI0do6Gnu/Cg0f0hMd IZPkx0SqN8nskn0kGbkKcHWSFGMYYMxLVCDuOGvncrjWUcZBcphNarTvrdj1BTTUZA0s F8XW9kN/3Zas7sWTjmdD/WIWp7Gmqi9QS1v2ACPDObAkkjj0kk2xRQnw+miPLCrctWYE Bx6DnRBSisRgSlmJXRdxaCIrVyNSjFHDJ1+CIZ2uUjme+vE/lU7O9JghtWh7vNt6bgeJ yi5+8B5Dp26G2KW3un+8s6HbHFuWk/WHKPw84QmAEkv6Np/a9rAjlnkxIO+0zozpG3NY o06g== X-Gm-Message-State: AOAM533Xgdto/iv8OZUXCylgflGa6YiPesE9Bha/vygPc1RVGl1HkV+r kDNU4ocmdKdId7yNubeK1/9/4Pyx3pXWEyzSS7SKN8Alzlkom4/W X-Google-Smtp-Source: ABdhPJw79z4kbxmLZSzl+awkqWOOTsYfhSN+jf+510eZJO0GNzdbELDq+JxL2Dzr3uNBdoStJ4xQEHfcFzx9lmN2mu8= X-Received: by 2002:a05:6512:3f9f:: with SMTP id x31mr12129365lfa.233.1631958681003; Sat, 18 Sep 2021 02:51:21 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x131.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:133081 Archived-At: `C-h o with-eval-after-load RET' gives the following description: with-eval-after-load is a Lisp macro in =E2=80=98subr.el=E2=80=99. (with-eval-after-load FILE &rest BODY) Execute BODY after FILE is loaded. FILE is normally a feature name, but it can also be a file name, in case that file does not provide any feature. See =E2=80=98eval-after-lo= ad=E2=80=99 for more details about the different forms of FILE and their semantics. ;;; 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 (define-key python-mode-map (kbd "C-c TAB") 'hs-toggle-hiding) (add-to-list 'python-shell-completion-native-disabled-interpreters "jupyter") ) 'elpy (pyvenv-activate "~/.pyenv/versions/datasci") ) Is there anything wrong with my understanding of this macro? Any hints will be helpful. Regards --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province