unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thibaut Verron <thibaut.verron@gmail.com>
To: Naoya Yamashita <conao3@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>,
	Richard Stallman <rms@gnu.org>, Ergus <spacibba@aol.com>
Subject: Re: Include leaf in Emacs distribution
Date: Sun, 11 Oct 2020 19:12:27 +0200	[thread overview]
Message-ID: <CAFsi02TVXSvWqcr2KHrTJRm7o6wqe2ZqSew7v_T8sM-FG6Gg-A@mail.gmail.com> (raw)
In-Reply-To: <20201012.015006.609810755286080528.conao3@gmail.com>

> 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	other threads:[~2020-10-11 17:12 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 [this message]
2020-10-12  2:10                 ` Naoya Yamashita
2020-10-12 20:23                   ` Ergus via Emacs development discussions.
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFsi02TVXSvWqcr2KHrTJRm7o6wqe2ZqSew7v_T8sM-FG6Gg-A@mail.gmail.com \
    --to=thibaut.verron@gmail.com \
    --cc=conao3@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=spacibba@aol.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).