By default, all packages are loaded with :straight
and :defer
keywords.
To load a library
which is not a package, one has to use :straight nil
statement in the use-package
declaration:
(use-package library
:straight nil)
If a package
(or library) has to be loaded as soon as some feature
loads with the use of :after
keyword, then one has to explicitly add also :demand
keyword to the use-package
declaration:
(use-package package
:demand :after feature)
Note that :demand
will not force the package to be loaded at startup in this case.
It will actually be deferred until feature
is loaded.
Use the following snippet:
(defun my/setup-<smth>-in-<some>-mode ()
"Description."
(add-hook '<hook-name> #'<smth> nil t))
(add-hook '<some>-mode-hook #'my/setup-<smth>-in-<some>-mode)