From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: Re: [Question] use-package's :init or :config for enabling modes Date: Sun, 19 May 2024 23:03:49 -0500 Message-ID: <875xv99lju.fsf@rodrigomorales.site> References: <87zfslya6d.fsf@rodrigomorales.site> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16491"; mail-complaints-to="usenet@ciao.gmane.io" Cc: To: Ergus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 20 06:04:53 2024 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 1s8uGb-0004Ab-60 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 20 May 2024 06:04:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8uG2-0002z2-Df; Mon, 20 May 2024 00:04:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8uFm-0002yM-72 for help-gnu-emacs@gnu.org; Mon, 20 May 2024 00:04:02 -0400 Original-Received: from smtpout1.mo12.mail-out.ovh.ca ([51.161.45.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8uFf-00030B-OM for help-gnu-emacs@gnu.org; Mon, 20 May 2024 00:04:00 -0400 Original-Received: from mxplan1.mail.ovh.ca (unknown [10.111.58.216]) by mo12.mail-out.ovh.ca (Postfix) with ESMTPS id 4VjP7r1LH1zHpty; Mon, 20 May 2024 01:03:52 -0300 (ADT) Original-Received: from rodrigomorales.site (54.39.251.57) by DAG2EX1.mxpca1.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 20 May 2024 00:03:51 -0400 Authentication-Results: garm.ovh; auth=pass (GARM-95B0029a982be0-3c2e-4a18-94be-e32dddcc4f80, C7B246BAB860EEFCF5BA39519EB15C960B261F38) smtp.auth=me@rodrigomorales.site X-OVh-ClientIp: 190.234.175.154 In-Reply-To: X-Originating-IP: [54.39.251.57] X-ClientProxiedBy: DAG2EX2.mxpca1.local (172.16.2.12) To DAG2EX1.mxpca1.local (172.16.2.11) X-Ovh-Tracer-GUID: 081727da-9ce0-44fb-ad51-fc74745af03f X-Ovh-Tracer-Id: 14674697914651319962 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdehledgjeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufgjfhffkfggtghisehttdertddttddtnecuhfhrohhmpeftohgurhhighhoucfoohhrrghlvghsuceomhgvsehrohgurhhighhomhhorhgrlhgvshdrshhithgvqeenucggtffrrghtthgvrhhnpeehtdehgeegleegueehtdeulefgjeehtdejhfduveeiheegfefgudegueelkeevgeenucfkphepuddvjedrtddrtddruddpheegrdefledrvdehuddrheejpdduledtrddvfeegrddujeehrdduheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehmvgesrhhoughrihhgohhmohhrrghlvghsrdhsihhtvgdpnhgspghrtghpthhtohepvddprhgtphhtthhopehsphgrtghisggsrgesrgholhdrtghomhdprhgtphhtthhopehhvghlphdqghhnuhdqvghmrggtshesghhnuhdrohhrghdpoffvtefjohhsthepmhhouddvpdhmohguvgepshhmthhpohhu th Received-SPF: pass client-ip=51.161.45.254; envelope-from=me@rodrigomorales.site; helo=smtpout1.mo12.mail-out.ovh.ca X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146786 Archived-At: Ergus writes: > When we defer the load (either with the :defer, :command or :keys) the > package is lazily loaded using the autoload mecanisms. > > #+BEGIN_SRC elisp > (use-package vertico :defer t > :init > (message "Call 1") ;; this will execute always > :config > (message "Call 2") ;; this will execute after M-x vertico-mode > (vertico-mode 1)) > #+END_SRC Running (message ...) inside :init and :config made it easier to understand when they are run. Thanks for the idea. It is more clear now.