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: Thibaut Verron
Subject: Re: Include leaf in Emacs distribution
Date: Sun, 11 Oct 2020 19:12:27 +0200

> Good point.  Since `(use-package emacs)` generates `(require
> 'emacs)`, we need to use such a hack to generate a harmless
> require statement.  Since leaf generates prog1 without a keyword,
> no hack is needed.  You can write a leaf expression with free
> descriptive symbols such as `(leaf *elpa-workaround)`.  You can
> also descrive this using use-package, but this requires the
> `:no-require` keyword in each use-package expression to suppress
> generate `require` Sexp.

Okay, that is definitely added value.

> No.  Please expand like `(use-package flymake)`.  This
> use-package expression is expanded `(require 'flymake)`.  On the
> other hand, `(leaf flymake)` is expanded `(prog1 'flymake)` which
> just wrap other generated Sexps.

Because I'm using straight the actual expansion is more complicated,
but the require is there.

(progn
  (straight-use-package 'flymake)
  (defvar use-package--warning98
    #'(lambda
(keyword err)
(let
    ((msg
      (format "%s/%s: %s" 'flymake keyword
      (error-message-string err))))
  (display-warning 'use-package msg :error))))
  (condition-case-unless-debug err
      (if
  (not
   (require 'flymake nil t))
  (display-warning 'use-package
   (format "Cannot load %s" 'flymake)
   :error))
    (error
     (funcall use-package--warning98 :catch err))))

> > In particular, if there are no autoloads, you need to explicitly
> > "require" the package in :init, no?
>
> If you need `require` package, you can use explicit `:require`
> keyword in leaf.  But, because now modern packages is well
> configured and maintained autoload comment, we don't needed
> explicit `require` Sexp.  So leaf contribute speeding up Emacs's
> startup time.  This has been reported by users who have migrated
> from use-package to leaf.

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. :)

>
> > In usual tree terminology (both in graph theory and in botany), leaves
> > do not have children. So the name does not really convey the meaning
> > that leaves are expected to be nested.
>
> Yes, good point.  This is true.
>
> Since I manage over 200 packages with this package, I needed to
> find the names of the packages as short as possible as I would be
> describing them over and over again.

Sorry, I don't understand.

>
> My favorite features in use-package are :disabled and :when.  As
> a chunk of configuration, these could be disabled on a
> situational basis, contributing to quick init.el management.

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.

> And already leaf is an ELPA package[2] and has a large number of
> users with over 150,000+ downloads from MELPA[3].  In addition,
> there are several packages[3] that depend on leaf.  Changing the
> name of leaf from now on is not practical I think.
>
> (DISCLAIMER:
> use-package is downloaded 1,100,000+ from MELPA[4].  This is
> because it's been distributed by MELPA since 2013 and because
> it's the first package in this field.  leaf has been distributed
> since 2019 and is in the process of rapidly growing its user base.)

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.

Also some package managers, such as straight, can completely bypass
melpa (and elpa too? not sure).

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.



reply via email to

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