From: Ergus via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel@gnu.org, Naoya Yamashita <conao3@gmail.com>,
thibaut.verron@gmail.com
Cc: eliz@gnu.org,rms@gnu.org
Subject: Re: Include leaf in Emacs distribution
Date: Mon, 12 Oct 2020 22:23:06 +0200 [thread overview]
Message-ID: <CF4F8BFD-28FD-4B0C-8574-0B6917965142@aol.com> (raw)
In-Reply-To: <20201012.111045.170746562384965042.conao3@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5164 bytes --]
I have to say that I have use-packages since ever with no issues; and just very recently I tried leaf and it has indeed a cleaner/simpler implementation some improve in startup time and more coherent syntax. Also extensibility/api looks as well a bit more coherent.
BUT we must find a better alternative than adding two overlapping packages to vanilla. It doubles the code with half benefit.
use-package is indeed the sort of standard but IMO a bit too much code. Before coming to vanilla either leaf or use-package will need some modifications, so maybe we should somehow require use-packages to include the leaf improves (or viceversa) before coming to vanilla. If it breaks backward compatibility with the original packages it is not a problem as they are not in vanilla yet and use-package is not even in elpa... We must priorize functionality and future maintainability over backward compatibility of external code; in this case we can assert it before including any alternative because once inside the backward compatibility requirement will be stronger.
On October 12, 2020 4:10:45 AM GMT+02:00, Naoya Yamashita <conao3@gmail.com> wrote:
>
>> Okay, that is definitely added value.
>
>Thanks.
>
>> Because I'm using straight the actual expansion is more complicated,
>> but the require is there.
>
>? Yes, use-package is expand `require` Sexp, but leaf is not.
>
>```
>(let ((use-package-expand-minimally t))
> (macroexpand-1
> '(use-package flymake)))
>;;=> (require 'flymake nil nil)
>
>(let ((leaf-expand-minimally t))
> (macroexpand-1
> '(leaf flymake)))
>;;=> (prog1 'flymake)
>```
>
>> I was talking about use-package. I have a lot of requires in my
>> init.el, but I don't know if they are all necessary. Maybe they are
>> only needed for packages for which I had to supply :init
>> specifications, or maybe they are not needed at all.
>>
>> As for startup time, it is 2s and I use emacsclient. I voluntarily
>> choose to load everything at start-up, those 2 seconds are a minor
>> annoyance maybe once a day, which is a lot preferrable to several
>> minor annoyances when I first open a tex, org or pdf file.
>>
>> I have no doubt that leaf has a similar option as use-package to
>never
>> defer loading. :)
>
>leaf always trusts autoload and does not always require it, so
>require is only done for packages that explicitly require
>it. Therefore, require is only done for packages that explicitly
>specify a requirement. This design was not possible in 2013 when
>use-package was created, but few current packages require an
>explicit request.
>
>> Interesting. For me :when is the most disappointing feature. My
>> typical use-case for conditionally loading a package is the
>> availability of some program on the system, or having or not sudo
>> rights. Because the :when keyword applies to loading the package, as
>> opposed to installing it, I cannot use it in this case.
>>
>> So I have a couple (when my-bool (use-package ...)) in my init.
>
>Oh, then you can use leaf's :when keyword. :when is set more
>priority from :ensure, so you can controll :ensure keyword using
>:when keyword.
>
>See this example. leaf generate Sexp what you want.
>
>```
>(setq leaf-expand-minimally t)
>(setq use-package-expand-minimally t)
>
>(macroexpand-1
> '(use-package flyspell-correct
> :when (executable-find "aspell")
> :ensure t
> :hook org-mode-hook))
>;;=> (progn
>;; (use-package-ensure-elpa 'flyspell-correct '(t) 'nil)
>;; (when (executable-find "aspell")
>;; (unless (fboundp 'flyspell-correct)
>;; (autoload #'flyspell-correct "flyspell-correct" nil t))
>;; (add-hook 'org-mode-hook-hook #'flyspell-correct)))
>
>(macroexpand-1
> '(leaf flyspell-correct
> :when (executable-find "aspell")
> :ensure t
> :hook org-mode-hook))
>;;=> (prog1 'flyspell-correct
>;; (unless (fboundp 'flyspell-correct-mode)
>;; (autoload #'flyspell-correct-mode "flyspell-correct" nil t))
>;; (when (executable-find "aspell")
>;; (leaf-handler-package flyspell-correct flyspell-correct nil)
>;; (add-hook 'org-mode-hook #'flyspell-correct-mode)))
>```
>
>> It might be the best we have, but counting downloads does not count
>> individual users. Some users will bootstrap multiple instances of
>> emacs with use-package or leaf, each resulting in one download.
>
>It say `download` but download from same IP, count as 1, I
>remmember (but no source comment...)
>
>> Also some package managers, such as straight, can completely bypass
>> melpa (and elpa too? not sure).
>
>True.
>
>> And I wouldn't be too surprised if a significant part of leaf's 150k
>> were already included in the 1.1M of use-package.
>>
>> It's only tangentially related, but maybe we could suggest that Melpa
>> report downloads per year, that might already give a better measure
>of
>> the number of current users.
>
>There are idea[1] but it is not implemented?
>
>[1]: https://github.com/melpa/melpa/issues/2416
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: Type: text/html, Size: 6455 bytes --]
next prev parent reply other threads:[~2020-10-12 20:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 1:37 Include leaf in Emacs distribution Naoya Yamashita
2020-10-08 9:00 ` Ergus
2020-10-08 9:22 ` Naoya Yamashita
2020-10-10 10:11 ` Eli Zaretskii
2020-10-11 5:24 ` Richard Stallman
2020-10-11 8:39 ` Naoya Yamashita
2020-10-11 9:52 ` Thibaut Verron
2020-10-11 16:50 ` Naoya Yamashita
2020-10-11 17:12 ` Thibaut Verron
2020-10-12 2:10 ` Naoya Yamashita
2020-10-12 20:23 ` Ergus via Emacs development discussions. [this message]
2020-10-11 17:02 ` Stefan Kangas
2020-10-11 16:51 ` Stefan Kangas
2020-10-12 20:53 ` Mingde (Matthew) Zeng
2020-10-11 17:22 ` Stefan Kangas
2020-10-12 1:35 ` Naoya Yamashita
2020-10-12 22:13 ` Stefan Kangas
2020-10-12 22:19 ` Qiantan Hong
2020-10-12 22:39 ` Caio Henrique
2020-10-13 13:23 ` Stefan Monnier
2020-10-13 14:14 ` Thibaut Verron
2020-10-13 14:29 ` Stefan Monnier
2020-10-13 15:29 ` Thibaut Verron
2020-10-18 9:32 ` Phil Sainty
2020-10-13 15:25 ` Caio Henrique
2020-10-23 2:37 ` Naoya Yamashita
2020-10-23 3:41 ` John Wiegley
2020-10-23 14:33 ` Stefan Monnier
2020-10-23 15:53 ` Naoya Yamashita
2020-10-23 16:46 ` Warnings in init files (was: Include leaf in Emacs distribution) Stefan Monnier
2020-10-23 18:11 ` Include leaf in Emacs distribution T.V Raman
2020-10-23 18:41 ` Stefan Kangas
2020-10-23 20:04 ` John Wiegley
2020-11-16 5:29 ` Naoya Yamashita
2020-11-17 0:39 ` John Wiegley
2020-11-20 11:04 ` Naoya Yamashita
2020-11-20 11:29 ` Pankaj Jangid
2020-11-20 15:44 ` T.V Raman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CF4F8BFD-28FD-4B0C-8574-0B6917965142@aol.com \
--to=emacs-devel@gnu.org \
--cc=conao3@gmail.com \
--cc=eliz@gnu.org \
--cc=rms@gnu.org \
--cc=spacibba@aol.com \
--cc=thibaut.verron@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.