emacsorphanage / req-package

dependency management system on top of use-package
GNU General Public License v3.0
152 stars 14 forks source link

:require behavior #43

Closed hrehfeld closed 6 years ago

hrehfeld commented 7 years ago

I don't quite understand how :require is supposed to work. I have the following:

On the load-path:

my-org-config-private.el:

(message "org private loaded")
(provide my-org-config-private)

my-org.el:

(req-package org
  :require my-org-config-private
  :ensure t
  :commands (
             org-agenda
             org-iswitchb
             org-store-link
             org-insert-link
             org-capture
             )
  :bind (
         ("C-c a" . org-agenda)
         ("C-c b" . org-iswitchb)
         ("C-c l" . org-store-link)
         ("C-c L" . org-insert-link)
         ("C-c c" . org-capture)
         ("C-c C-x C-x" . org-clock-in-last)
         ("C-c C-x C-o" . org-clock-out)
         )
)
(provide 'my-org)

init.el:

....
(req-package my-org)
(req-package-finish) ;edited

However, I experience the following behavior:

If I remove :require my-org-config-private from that call:

[Ignore this line. It breaks the lists into two, because markdown is a markup language with problems.]

It would be really nice to have some more documentation...

edvorg commented 7 years ago

Hi. First question. Did you call req-package-finish after all your req-package calls?

hrehfeld commented 7 years ago

Yes!

edvorg commented 7 years ago

@hrehfeld Could you please provide your load-path value when calling a req-package function, req-package-log--open-log output and emacs and req-package verions?

I think your my-org-config-private file isn't on the load path. Req-package can't find it when you call req-package with :require my-org-config-private and this blocks execution of req-package org.

edvorg commented 7 years ago

also could switch to debug level before taking logs please?

edvorg commented 7 years ago

If I have multiple packages calling req-package specific-pkg, are options merged?

options are never merged. but you could have multiple calls to one package if you have different dependencies in :require section

edvorg commented 7 years ago

My plan was to have a really modular config... What's best practice for local-only files providing stuff if they depend upon other packages? The idea was to create mini-packages that do nothing but provide config.

I think you should take a look at my emacs configuration as described in readme https://github.com/edvorg/emacs-configs This could be a good starting point.

edvorg commented 7 years ago

Also please be sure that you've read the usage section. It has an example with loading a file from the load path https://github.com/edvorg/req-package#usage

hrehfeld commented 7 years ago

Thanks for the comments. I read everything you hinted at before posting (however, I'm still pretty unsure about the exact function of things, spec would be nice).

Your config doesn't seem to recursively include?

My current config is here: https://github.com/hrehfeld/.emacs.d I wonder if req-package can give me any advantages? The basic infrastructure is already setup, but almost no packages use req-package.

edvorg commented 7 years ago

Ok so the spec is simple. We have a req-package macro form, which is just an extension to use-package. It adds a few new configuration keywords.

So my guess I still intact.. you probably didn't specify a load path to your my-org-config-private. Please check this first.

I'm sorry I'm not sure I understand the last question about the architecture. My rule of thumb is to split my configuration in some modules like clojure, haskell, emacs appearance. These modules would include several req-package forms for packages that are related. These packages sometimes have dependencies on each other (even across different modules). After requiring all the modules I call req-package-finish. Which will resolve the dependencies and load everything in correct order while keeping my .emacs.d modular.

Hope it's helpful.

edvorg commented 6 years ago

Closed due to no activity and breaking changes in v1.1