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: Caio Henrique
Subject: Re: Include leaf in Emacs distribution
Date: Tue, 13 Oct 2020 12:25:08 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> IMO it would help with the "emacs wizard" proposal. For instance, if
>> there is a "install undo-tree and enable it globally" option on the
>> wizard, it could generate something like this on the emacs init file:
>>
>> (use-package undo-tree
>>   :ensure t
>>   :diminish undo-tree-mode
>>   :config (global-undo-tree-mode))
>
> Why not just use
>
>     (global-undo-tree-mode 1)
>
> ?
>
> Assuming the `gnu-elpa` package is installed (which I'd hope we could
> bundle with Emacs-28), then it should do pretty much the same as your
> `use-package` code above, except for the `diminish` which seems
> orthogonal (if we think it should be diminished by default, then we
> should change undo-tree accordingly).
>
>
>         Stefan

That was just a simple example from my init file to try to show that
use-package or leaf could help to keep package configurations more
consistent and that it could be used by the code generated by the "emacs
wizard", thus we have reasons to include use-package or leaf on the
Emacs core. So I was not suggesting to add undo-tree or diminish on the
"emacs wizard". 

Imagine that we have a lot of recipes on the "emacs wizard" for several
different packages with more complex declarations, in this case
use-package or leaf can keep things more organized and consistent. (I
know that this is subjective.)

Here are some more examples from my init file:

(use-package ivy
  :straight t
  :diminish ivy-mode
  :defer 0.9
  :config
  (use-package swiper
    :straight t
    :bind (("C-s" . swiper)
           ("C-M-s" . swiper-thing-at-point)))
  (use-package counsel
    :straight t
    :diminish counsel-mode
    :config (counsel-mode))
  (use-package ivy-avy
    :straight t)
  (ivy-mode))

(use-package company
  :straight t
  :commands company-mode
  :bind (:map company-active-map
         ("C-n" . 'company-select-next)
         ("C-p" . 'company-select-previous))
  :config
  (use-package company-quickhelp
    :straight t
    :hook (company-mode . company-quickhelp-local-mode)))

(use-package lsp-mode
  :straight t
  :hook
  ((c++-mode . lsp)
   (c-mode . lsp)
   (js-mode . lsp)
   (python-mode . lsp)))



reply via email to

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