You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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
I often run into situations where package
B
depends on a symbol from packageA
.Usually, it is enough to make sure that the
use-package
form for packageA
occurs before theuse-package
form for packageB
. It would be nice, though, to be able to decouple the init-file layout from the dependency order of theuse-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 theuse-package
form for packageA
. Now theuse-package
form for packageA
has to "know" about the fact that anotheruse-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
.The text was updated successfully, but these errors were encountered: