emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include leaf in Emacs distribution


From: Ergus
Subject: Re: Include leaf in Emacs distribution
Date: Mon, 12 Oct 2020 22:23:06 +0200
User-agent: K-9 Mail for Android

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.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]