emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
227 stars 17 forks source link

Documentaion for eldev-before-loading-dependencies-hook is inaccurate #42

Closed DarwinAwardWinner closed 3 years ago

DarwinAwardWinner commented 3 years ago

The documentation for eldev-before-loading-dependencies-hook says that the 2nd argument received by hook functions is a list of additional sets, but in practice this argument seems to just be a single symbol.

Also, more generally, the convention for hook naming is that hooks that receive arguments should be named ...-functions instead of ...-hook. (See the section on hooks in the Emacs manual.) You might want to consider renaming some of Eldev's hook variables accordingly.

doublep commented 3 years ago

The documentation was correct, implementation was not. You can always convert to a list using eldev-listify (and this is what will be done by the caller already in 0.9.1, so that the functions will always receive a list as a parameter, as promised by the documentation). The reason it cannot always be just a symbol is that eldev-load-project-dependencies etc. optionally accepts a list of sets, so we have to go with the broader option.

About naming: I agree it would have been better to follow conventions, but I guess it's too late to rename now and I don't want to add more deprecated synonyms. I'll just add a note about this (i.e. not following the conventions) to the documentation instead.