Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Already installed packages with :feather t keyword are not loaded #11

Open
fernandodemorais-jf opened this issue Feb 25, 2021 · 6 comments

Comments

@fernandodemorais-jf
Copy link

Hello,

Considering the following snippet as an example:

(leaf feather
  :ensure t
  :blackout (feather-mode . nil)
  :global-minor-mode feather-mode)

(leaf zerodark-theme
  :feather t
  :setq ((zerodark-use-paddings-in-mode-line . nil))
  :config (load-theme 'zerodark t))

When I include this snippet in my init.el and run Emacs with it, if the theme is not installed, feather is able to install zerodark-theme and the package is loaded as intended.

However, if I restart Emacs zerodark-theme is no longer loaded. I need to comment :feather t line and restart Emacs, or evaluate the theme block to load it.

Maybe I missed some fether (or even leaf) configuration?

Thanks!

@conao3
Copy link
Owner

conao3 commented Feb 26, 2021

Please try this init.el
Sorry, current README is outdated and I must update it.

@fernandodemorais-jf
Copy link
Author

fernandodemorais-jf commented Feb 26, 2021

Hello @conao3!

I tried the init.el that you've suggested, and the behavior was the same: if the :ensure t keyword (following the feather configuration block, after setting ((leaf-alias-keyword-alist . '((:ensure . :feather))))) is in the leaf block of a package, it will be installed and loaded the first time you start Emacs, but if you restart the package will not load.

Oddly enough, if I write the following in the init.el:

(leaf feather
  :ensure t
  :custom ((leaf-alias-keyword-alist . '((:ensure . :feather))))
  :config (feather-mode))

(leaf zerodark-theme :ensure t)
(leaf zerodark-theme
  :setq ((zerodark-use-paddings-in-mode-line . nil))
  :config (load-theme 'zerodark t))

zerodark-theme will be installed, but not loaded, because leaf will raise a warning (informing that the package is not installed) and restarting Emacs will load the theme as expected. 😅

But, even if there is this workaround to use feather with leaf, there would be no other way to use :ensure t or :feather t inside a leaf configuration block, without the need to replicate it just to (leaf <package-name> :ensure t)?

Thanks!

P.S.: by the way, leaf-manager is an awesome package! 😃

@alekfed
Copy link

alekfed commented Mar 13, 2021

I have the same issue, configuration from aforementioned init.el didn't help to solve it.

Perhaps, it's not a problem of feather.el itself and this problem has something to do with recent leaf-keywords.el activity, because :ensure keyword works fine without alias ((leaf-alias-keyword-alist . '((:ensure . :feather)))), but :feather keyword doesn't work at all even without alias.

@fernandodemorais-jf
Copy link
Author

fernandodemorais-jf commented Nov 3, 2021

Hello @conao3!

After some investigation, based on @alekfed comment, I managed to find a solution to this issue.

In fact, the source of the issue is precisely in the :feather keyword in leaf-keywords.el code.

The list generated by the feather-add-after-installed-hook-sexp macro was not being evaluated, so I just added an eval to line 104 of the leaf-keywords.el package:

(leaf-list
   :feather    `(,@(mapcar (lambda (elm) `(leaf-handler-package ,leaf--name ,(car elm) ,(cdr elm))) leaf--value)
                 (eval (feather-add-after-installed-hook-sexp ,(caar (last leaf--value)) ,@leaf--body))) ; <-- Here.

I don't know if its the best solution, but it manages to solve the problem and now already installed packages are loaded, even with the :feather keyword!

Thanks!

@conao3
Copy link
Owner

conao3 commented Nov 3, 2021

Thanks, PR welcome!

@fernandodemorais-jf
Copy link
Author

Thanks, PR welcome!

Done! 🤝

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants