renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
369 stars 28 forks source link

Package autoloads? #44

Open proofit404 opened 1 year ago

proofit404 commented 1 year ago

Some users do not use use-package.

That's mean they have to (require 'treesit-auto) before they could call (global-treesit-auto-mode) in the configuration file.

To avoid this situation package could specify special auto load pragma. For example, like this.

Usually, it's good tone to set it for all interactive commands defined in the package.

Is there any specific technical reason not to set auto load comments?

renzmann commented 1 year ago

I did try this, but my skill with elisp wasn't quite good enough to overcome cl-lib failing to load properly: https://github.com/renzmann/treesit-auto/issues/36#issuecomment-1474875674

If you are familiar with the proper way to get ;;;###autoload working without any errors on startup I'd love the PR for it!

sebastiaanspeck commented 6 months ago

Does https://github.com/renzmann/treesit-auto/pull/87 solve this?

noctuid commented 2 months ago

No, I didn't add an autoload cookie for the global minor mode in that PR. The last sentence in that PR explains why an autoload cookie will not work with how the current code is setup. Basically, the problem is that the :predicate depends on code which will not be pulled into/available in the autoload file, which is why there are errors.