Giter Site home page Giter Site logo

Comments (3)

jerrypnz avatar jerrypnz commented on September 24, 2024 1

Could you try adding :demand t and see if works for you?

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

major-mode-hydra needs to be requried before those keywords can be used. Without :demand t the package is not loaded immediately.

from major-mode-hydra.el.

hjpotter92 avatar hjpotter92 commented on September 24, 2024

The debug error trace:

Debugger entered--Lisp error: (error "use-package: Unrecognized keyword: :mode-hydra")
  signal(error ("use-package: Unrecognized keyword: :mode-hydra"))
  error("use-package: %s" "Unrecognized keyword: :mode-hydra")
  use-package-normalize-plist(emacs-lisp-mode (:mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra")))) nil use-package-merge-keys)
  use-package-normalize-plist(emacs-lisp-mode (:after (major-mode-hydra) :mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra")))) nil use-package-merge-keys)
  use-package-normalize-plist(emacs-lisp-mode (:ensure nil :after (major-mode-hydra) :mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra")))) nil use-package-merge-keys)
  use-package-normalize-keywords(emacs-lisp-mode (:ensure nil :after (major-mode-hydra) :mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra")))))
  #f(compiled-function (name &rest args) "Declare an Emacs package by specifying a group of configuration options.\n\nFor full documentation, please see the README file that came with\nthis file.  Usage:\n\n  (use-package package-name\n     [:keyword [option]]...)\n\n:init            Code to run before PACKAGE-NAME has been loaded.\n:config          Code to run after PACKAGE-NAME has been loaded.  Note that\n                 if loading is deferred for any reason, this code does not\n                 execute until the lazy load has occurred.\n:preface         Code to be run before everything except `:disabled'; this\n                 can be used to define functions for use in `:if', or that\n                 should be seen by the byte-compiler.\n\n:mode            Form to be added to `auto-mode-alist'.\n:magic           Form to be added to `magic-mode-alist'.\n:magic-fallback  Form to be added to `magic-fallback-mode-alist'.\n:interpreter     Form to be added to `interpreter-mode-alist'.\n\n:commands        Define autoloads for commands that will be defined by the\n                 package.  This is useful if the package is being lazily\n                 loaded, and you wish to conditionally call functions in your\n                 `:init' block that are defined in the package.\n:hook            Specify hook(s) to attach this package to.\n\n:bind            Bind keys, and define autoloads for the bound commands.\n:bind*           Bind keys, and define autoloads for the bound commands,\n                 *overriding all minor mode bindings*.\n:bind-keymap     Bind a key prefix to an auto-loaded keymap defined in the\n                 package.  This is like `:bind', but for keymaps.\n:bind-keymap*    Like `:bind-keymap', but overrides all minor mode bindings\n\n:defer           Defer loading of a package -- this is implied when using\n                 `:commands', `:bind', `:bind*', `:mode', `:magic', `:hook',\n                 `:magic-fallback', or `:interpreter'.  This can be an integer,\n                 to force loading after N seconds of idle time, if the package\n                 has not already been loaded.\n:after           Defer loading of a package until after any of the named\n                 features are loaded.\n:demand          Prevent deferred loading in all cases.\n\n:if EXPR         Initialize and load only if EXPR evaluates to a non-nil value.\n:disabled        The package is ignored completely if this keyword is present.\n:defines         Declare certain variables to silence the byte-compiler.\n:functions       Declare certain functions to silence the byte-compiler.\n:load-path       Add to the `load-path' before attempting to load the package.\n:diminish        Support for diminish.el (if installed).\n:delight         Support for delight.el (if installed).\n:custom          Call `customize-set-variable' with each variable definition.\n:custom-face     Call `customize-set-faces' with each face definition.\n:ensure          Loads the package using package.el if necessary.\n:pin             Pin the package to an archive." #<bytecode 0x1560fa88a3d1>)(emacs-lisp-mode :ensure nil :after (major-mode-hydra) :mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra"))))
  macroexpand((use-package emacs-lisp-mode :ensure nil :after (major-mode-hydra) :mode-hydra ("Eval" (("b" eval-buffer "buffer") ("e" eval-defun "defun") ("r" eval-region "region")) "REPL" (("I" ielm "ielm")) "Test" (("t" ert "prompt") ("T" (ert t) "all") ("F" (ert :failed) "failed")) "Doc" (("d" describe-foo-at-point "thing-at-pt") ("f" counsel-describe-function "function") ("v" counsel-describe-variable "variable") ("i" info-lookup-symbol "info lookup")) "Quit" (("q" nil "quit hydra")))))
  elisp--eval-defun()
  eval-defun(nil)
  funcall-interactively(eval-defun nil)
  call-interactively(eval-defun nil nil)
  command-execute(eval-defun)

from major-mode-hydra.el.

hjpotter92 avatar hjpotter92 commented on September 24, 2024

That works. I had not read the following in use-package docs:

NOTE: Pay attention if you set use-package-always-defer to t, and also use the :after keyword, as you will need to specify how the declared package is to be loaded: e.g., by some :bind. If youโ€™re not using one of tho mechanisms that registers autoloads, such as :bind or :hook, and your package manager does not provide autoloads, itโ€™s possible that without adding :demand t to those declarations, your package will never be loaded.

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.