From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Adding use-package to core Date: Mon, 14 Nov 2022 15:17:22 +1100 Message-ID: <86sfimxfok.fsf@gmail.com> References: <838rkels13.fsf@gnu.org-NGltIw7----9> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26725"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.2; emacs 29.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 15 01:51:17 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oukAW-0006gW-PH for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Nov 2022 01:51:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouioY-0000XR-T9; Mon, 14 Nov 2022 18:24:30 -0500 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 1ouig8-0002E1-VP for emacs-devel@gnu.org; Mon, 14 Nov 2022 18:15:50 -0500 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ouS71-0000Je-1P for emacs-devel@gnu.org; Mon, 14 Nov 2022 00:34:28 -0500 Original-Received: by mail-pj1-x1035.google.com with SMTP id v4-20020a17090a088400b00212cb0ed97eso9593759pjc.5 for ; Sun, 13 Nov 2022 21:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:from:to:cc:subject:date:message-id:reply-to; bh=1FGUi4AIBqyOQbC9nwTA0oGUWpxNqpEobpKmKtb8yG8=; b=JLNuH3IlqhaV2+ixi29Q0usRE2v9niaIgRQF+4vRHjmDm5x1hQ62b1K1oEBpCr+M5o 1fTS2nQXmPRKR/AJnkGeruvYUG/BWnsxfhtHl8nzc3Idjq4z8pALK7Ukk5HdqiZihrBj CPt4+u0vruVpMAYojcY9vAP0winI1TNWGZc4j2MYoFdHGyjMgytJ3Pc8AIOFvqzTtixX cldGE34Ag/mCHZtUUqSpSq70fbKoQmhYzb5OxU8h24aVOWs2dSkzCJcs1070bsODxqDG tB6WBPv6XJW7JzjQ1jf2566ONr8tbruPPheQ/afUOsOHqVZpeOlIDqTyN5X0jngGg2oz 0eEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1FGUi4AIBqyOQbC9nwTA0oGUWpxNqpEobpKmKtb8yG8=; b=mzYYi3x41uCGZpT2Ob4a5QVOMp1OYu6Zdx8OsLpaIFaJ0YKbl//PSIGMC1VIBQFnZx iaPpS1KzZWUmup1VXCPr3BM2qHGLpTerS13PobLqWeu41im0STzqUAW2f1TBlt6dXRuo iWti1AXzD7BU7tx9VIbKhmyRbM9DdaBPrdSgdRrYy8hnUUHmULE2FGt/QXES0Po+i90f BDMVQDgEC35YbPzqwz5rVHoUOt/95eedObi1N2wHiwdafRYZQnhvWwYQGkiSS5pb71QN s3Ek8GjJacOLMmKeoI7DKsrqjxgUI0W+RDg9HAFS7vCsVwGMTXVaRx0AcDc3UFO2mAL+ AQJQ== X-Gm-Message-State: ANoB5pm8wisHAqXuoamdSKRFgPgeft977z7Vix9i/1GvJP7NasILI+zF vMDf3iAePfgjSxsuGBWl33Ar+VducDA= X-Google-Smtp-Source: AA0mqf6HlkJBoZKS9tmuuPbdvRCoqs6KiV2AJlwPVP1rBgo1iCtStAfj4Iv29CkHvygScp0ovGd+VA== X-Received: by 2002:a17:902:680b:b0:186:a2ef:7a74 with SMTP id h11-20020a170902680b00b00186a2ef7a74mr12290834plk.148.1668404064740; Sun, 13 Nov 2022 21:34:24 -0800 (PST) Original-Received: from dingbat (220-235-181-183.dyn.iinet.net.au. [220.235.181.183]) by smtp.gmail.com with ESMTPSA id 133-20020a62188b000000b005722f4dfbefsm872691pfy.193.2022.11.13.21.34.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 21:34:24 -0800 (PST) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1035.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299802 Archived-At: Drew Adams writes: >> To me, use-package and package.el are mainly orthogonal: >> Package.el is for package management (installing, updating, >> removing), while use-package is for customization beyond >> what Customize provides -- or at least allows you to >> concentrate changes related to the same package in one place. > > Speaking/asking from ignorance here... > > 1. "Customization beyond what Customize provides" > > What kinds of such customization, besides the > one you call out next (#2)? > > 2. "allows you to concentrate changes related > to the same package in one place" > > Can you be more specific here? How does what > you have in mind differ from what customize > groups provide? > Hi Drew, I'm not sure I agree with the statement from the post you are responding to and wanted to give a different perspective which might clarify why some like use-package. At its most fundamental level, use-package is really just syntactic sugar. It provides a somewhat more declarative way to manage package loading, initialisation, configuration and customisation. It takes functionality which largely already exists and puts it together in one declarative 'chunk'. Much of what it does is really just convenience macros which define a DSL for installing, loading and configuring packages. For example, it provides convenience features for defining key bindings, setting interpreters, autoloads, file associations, loading on demand or loading after something else has been loaded, adding hooks, setting customize variables, etc. Instead of having (unless (package-installed-p 'some-package) (package-install 'some-package)) (require 'some-package) (add-hook 'some-package-hook 'my-some-package-setup) (define-key some-package-map (kbd "C-c f") 'some-mode-do-something) ... (custom-set-variables `(some-package-var t)) I might just have (use-package some-package :ensure t :hook (some-package . my-some-package-setup) :bind ("C-c f" . some-mode-do-something) :custom (some-package-var t)) which would achieve the same thing. The 3 main reasons I use it are 1. I don't like the customize interface. This is not a criticism of customize. I don't like similar interfaces in other editors either. I find them slow and cumbersome. 2. I like having all the configuration for a package in one block/stanza. I could also do this with just normal elisp, but use-package provides some additional syntactic sugar which makes things less verbose. It also tends to lead to a more declarative configuration. 3. It makes it easy to delay loading of packages, temporarily disabling or defining when a package is loaded and encourages better habits by keeping all the configuration associated with a package together so that if I do temporarily disable it, I don't get other init failures when other parts of my init file try to reference something which is no longer being loaded. This isn't so much about what the package does as much as how it encourages better practice in managing your config.. In short, use-package doesn't provide new functionality as much as it provides an alternative approach to existing functionality. It adds another choice to how users can manage their configuration. Some people will like it, some will hate it and probably most won't really care one way or the other. After using it for many years, I can say it has certainly improved the management and maintenance of my init.el I do think it is worth adding to Emacs and because it can also manage installing packages from ELPA, I would love it if it was in Emacs core so I can just use it instead of first ensuring it has been installed and then using it.