Giter Site home page Giter Site logo

Comments (10)

nkpf42 avatar nkpf42 commented on June 23, 2024 1

So I tried to remove all after's and using only major-mode-hydra but it still doesn't work. To ensure I've got a clean state, I've uninstalled and reinstalled all of my packages but to no avail.
major-mode-hydra is the 2nd package in my init.el, the first being elpaca

I've found a solution with

;; hydra

(use-package major-mode-hydra)

(elpaca-wait)

By placing an elpaca wait after I think it prevents elpaca from loading the rest of the file. But I thought it was use-package who was in charge of parsing this init file. I will ask them what the hell is going on

from major-mode-hydra.el.

jerrypnz avatar jerrypnz commented on June 23, 2024

What version of Emacs and use-package are you using?

from major-mode-hydra.el.

nkpf42 avatar nkpf42 commented on June 23, 2024

I'm using

GNU Emacs 29.1.50
Development version 45cc57ac2586 on emacs-29 branch; build date 2023-08-21.

And I just realized that I didn't took a tag while compiling it myself. Shall I switch to stable commit and retry my setup to see if it's fixed?

And use-package is at 2.4.5

from major-mode-hydra.el.

nkpf42 avatar nkpf42 commented on June 23, 2024

Just switched to a stable emacs 29.1 version

GNU Emacs 29.1
Development version a9b28224af0f on HEAD branch; build date 2023-10-04.

Same version of use-package and bug still here

from major-mode-hydra.el.

bestlem avatar bestlem commented on June 23, 2024

Don't you need to load hydra by demand as well?
(use-package hydra :demand)
Otherwise pretty-hydra will never load

from major-mode-hydra.el.

nkpf42 avatar nkpf42 commented on June 23, 2024

It doesn't work too :/ I'm a bit at a loss here with use-package beahviour.

from major-mode-hydra.el.

bestlem avatar bestlem commented on June 23, 2024

What is the full use-package expression that you use that gives this error?

from major-mode-hydra.el.

nkpf42 avatar nkpf42 commented on June 23, 2024

This one

(use-package org-roam
  :after (pretty-hydra)
  :bind (("C-c n" . roam-hydra/body))
  :pretty-hydra (roam-hydra (:color teal :quit-key "q")
                 ("Roam"
                  (
                   ("l" org-roam-buffer-toggle)
                   ("f" org-roam-node-find)
                   ("i" org-roam-node-insert)
                   ("c" org-roam-capture)
                   ("t" org-roam-tag-add)
                   )
                  "Dailies"
                  (
                   ("j" org-roam-dailies-capture-today)
                   ("k" org-roam-dailies-capture-tomorrow)
                   ("h" org-roam-dailies-goto-yesterday)
                   ("a" org-roam-dailies-goto-today)
                   ("d" org-roam-dailies-goto-tomorrow)
                   ))
                 ))

from major-mode-hydra.el.

jerrypnz avatar jerrypnz commented on June 23, 2024

Without actually testing it, I wonder if it's the :after that's causing the issue for you. I'm using the same version of emacs and use-package 2.4.4 and it works fine for me.

To use :pretty-hydra, you need it loaded before any use-package with :pretty-hydra is called. In my config I have this loaded very early. I don't have a separate use-package for hydra and pretty-hydra as major-mode-hydra loads them all.

(use-package major-mode-hydra
  :straight t
  :demand t
  :bind
  (("C-M-SPC" . major-mode-hydra))

  :config
  (progn
    (setq major-mode-hydra-invisible-quit-key "q")
    (defun jp-major-mode-hydra-title-generator (_)
      `(with-mode-icon major-mode
                       (propertize (s-concat (format-mode-line mode-name) " Commands")
                                   'face '(:weight bold :height 1.1))
                       1.1))

    (setq major-mode-hydra-title-generator #'jp-major-mode-hydra-title-generator)))

Try removing the :after (hydra) and make sure it's loaded before other use-package calls.

from major-mode-hydra.el.

bestlem avatar bestlem commented on June 23, 2024

elpaca messes around with loading things by loading asyncronouslly.

As use-package and the :pretty-hydra are in a macro you need all of those bits loaded before using them.

So you need loading of use-package (well not since 29.1 as now in emacs) and loading pretty-hydra and hydra before an elpaca-wait. Then after the elpaca-wait you can use your code

I found elpaca requires too much changing and reordering of code to easily switch to - straight.el and package.el just required a few lines except for non standard packages.

from major-mode-hydra.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.