syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.57k stars 4.9k forks source link

configuration-layer/package-used-p is inconsistent with cfgl-package-used-p #16346

Open bcc32 opened 3 months ago

bcc32 commented 3 months ago

As mentioned in the title, the two functions configuration-layer/package-used-p and cfgl-package-used-p have inconsistent behavior with respect to certain packages.

In particular, if a package is disabled through a :toggle keyword whose form evaluates to nil, configuration-layer/package-used-p will return t for that package while cfgl-package-used-p will return nil.

cfgl-package-used-p's behavior seems more correct to me---these functions are used frequently in Spacemacs to figure out whether some other layer is going to configure that package and cause it to, for example, be responsible for implementing some key bindings. In which case, the :toggle evaluating to nil should cause the code to assume that the package in question is not used, for this purpose.

In any case, it seems like configuration-layer/package-used-p should be a very thin wrapper around cfgl-package-used-p and not implement any of its own logic. @smile13241324, do you agree with this idea?

smile13241324 commented 3 months ago

Yep I think this makes sense