From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: What does use-package do? Date: Tue, 11 Oct 2022 09:17:56 +0000 Message-ID: <87lepmg1mj.fsf@posteo.net> References: <87czb253h3.fsf@gmail.com> <87sfjyqy8o.fsf@disroot.org> <87ilkt2mks.fsf@posteo.net> 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="4212"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Akib Azmain Turja , Payas Relekar , emacs-devel@gnu.org, John Wiegley To: Naoya Yamashita Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 11:40: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 1oiBkH-0000wt-AX for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 11:40:17 +0200 Original-Received: from localhost ([::1]:41810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiBkF-0000fL-RQ for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 05:40:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiBOt-0002iZ-PG for emacs-devel@gnu.org; Tue, 11 Oct 2022 05:18:16 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:41609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiBOj-0006Tz-3j for emacs-devel@gnu.org; Tue, 11 Oct 2022 05:18:10 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 53D7D240105 for ; Tue, 11 Oct 2022 11:17:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665479878; bh=P2ZA/o/ac5IJO31KXhMT48WCMj98CvDDxS0VSqt21Do=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=hA47YDCed/Agc9IYejD2qiF7zRuqs9xD9MCwFvXHP7swmuX77fWx/+ZpQ0cQ+A9aZ gaM3S6rDh49QvPaQsmZYIqqawS41+C1YefpNEQg/pYOoG7dXe1HOxVKvnt4tTW24Sh AWNGJM1teoWosPQ4R+8eiETXDfgh5IE4/774GUd0jgOWLzojmifwvaAyD3I8WJEz1g ifIOUHbfFI0TWdOHnmAheDvbdiJrmQ0b9VlZryfVqAku2YC8Au7ToB3mZSYRU84cuY sD9vsutKb2tqO4ok4bVNxAg8Glm+77KXAiTfvfSt9kF9QbIGiXPxHzpV26kvcdW3N7 Coz78BUdY4MAw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mmqv92qsWz9rxG; Tue, 11 Oct 2022 11:17:57 +0200 (CEST) In-Reply-To: (Naoya Yamashita's message of "Tue, 11 Oct 2022 13:46:45 +0900") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable 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" Xref: news.gmane.io gmane.emacs.devel:297465 Archived-At: Naoya Yamashita writes: > (I used to send Email from gnus, but I have already lost my gnus > settings and will reply from Gmail. I hope I get it right.) > >> There was talk of integrating leaf into use-package a year ago. > > Nothing is going on with integrating leaf and use-package as no > one is working on it. Honestly, I don't like use-package because > it has surprising behavior that often seems nosy. That is why > leaf was created, to organize/reduce the features that > use-package has and to give user a better interface, which is > why it cannot be integrated. > > On the other hand, I agree that leaf has a puzzling internal > structure. It has huge conditional branches directly in a list, > dynamically generating S-expressions and eval'ing them. This > structure makes debugging difficult and adding new features > difficult for new people. (I can do it, though.) This is why I > am hesitant to have it standardized in Emacs. > > In summary, the functionality that use-package already provides > should be sorted out because it contains magic. The interface > provided by leaf is pretty, but it has a puzzling internal > structure. I would support a third use-package that should come > standard with Emacs, if there is one. And some people said that > the name "LEAF" is a bad name. Hopefully the third use-package > will have a better name. I am not sure if there is any interest, but my `setup' package[0] might be such a candidate, when combined with a "declarative to imperative" translation layer. I was playing with such a concept a few months ago[1], but never completed it. This specific implementation might be too "cl-generic"-heavy. But in principle it works: We start with a declarative expression: (use-setup foo :init (first we have) (to eval this) :config (do this) (then that) :hook (bar-mode) :bind ("C-f" . foo-forward) :custom (foo-option t)) which is translated into a `setup'-expression: (setup foo (:option foo-option t) (:bind "C-f" foo-forward) (:hook-into bar-mode) (:when-loaded :when-loaded (do this)) (progn (to eval this) (first we have))) that then expands to regular code: (progn (progn (custom-load-symbol 'foo-option) (funcall (or (get 'foo-option 'custom-set) (function set-default)) 'foo-option t)) (eval-after-load 'foo (function (lambda nil (define-key foo-mode-map "" (function foo-forward))))) (add-hook 'bar-mode-hook (function foo-mode)) (eval-after-load 'foo (function (lambda nil (do this) (then that)))) (progn (to eval this) (first we have))) [0] https://git.sr.ht/~pkal/setup [1] https://paste.sr.ht/~pkal/4b8519fca721e0ac651d5598f6d582ae92ff84dd > 2022=E5=B9=B410=E6=9C=8810=E6=97=A5(=E6=9C=88) 5:16 Stefan Kangas : > >> Philip Kaludercic writes: >> >> > Do you remember what thread that was, the only one I remember is >> > >> https://yhetil.org/emacs-devel/20201008.103747.1339582189858984269.conao= 3@gmail.com/ >> . >> >> Yes, that's the one I'm thinking of. >> >> I think you want to start reading at: >> >> https://yhetil.org/emacs-devel/CADwFkm=3DmSZHeKf0=3DG7rXhOKOqSxOYWwOQfUv= 8=3D7fZWEaDOCTKg@mail.gmail.com/ >>