Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: let :autoloads, :commands, :functions declare symbols for other packages #1086

Open
heraplem opened this issue Jan 4, 2025 · 0 comments

Comments

@heraplem
Copy link

heraplem commented Jan 4, 2025

I often run into situations where package B depends on a symbol from package A.

Usually, it is enough to make sure that the use-package form for package A occurs before the use-package form for package B. It would be nice, though, to be able to decouple the init-file layout from the dependency order of the use-package stanzas.

But the real problem comes if the byte-compiler can't see a needed function symbol from package A. In this case, I have to add a :functions, :commands, etc. to the use-package form for package A. Now the use-package form for package A has to "know" about the fact that another use-package form is going to depend on that symbol, which is less than ideal.

The alternative, of course, is to simply use define-function, etc. as needed, but that also seems less than ideal.

The solution I'm envisioning is to make it so that keywords that declare function symbols can additionally take, for each symbol, the name of the package that that symbol is from, with a syntax similar to :hook.

(use-package c
  :functions (a-foo . a)
             ((b-bar b-baz) . b)
  :config
  (setq c-xxx (+ (a-foo) (b-bar) (b-baz))))

(use-package a)
(use-package b)
@heraplem heraplem changed the title Feature request: let :defines, :functions etc. declare symbols for other packages Feature request: let :autoloads, :commands, :functions declare symbols for other packages Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant