bbatsov / emacs-lisp-style-guide

A community-driven Emacs Lisp style guide
1.08k stars 53 forks source link

Add section on loading and autoloading #27

Closed shosti closed 10 years ago

shosti commented 10 years ago

One thing I'm not entirely sure about: should defcustoms be autoloaded? It doesn't seem like they usually are, but it seems like it would be nice to edit options without requiring the library.

bbatsov commented 10 years ago

It doesn't seem like they usually are, but it seems like it would be nice to edit options without requiring the library.

You can set any variable prior to loading the file in which it's defined, anyways.

bbatsov commented 10 years ago

The suggested additions look good. :+1:

Malabarba commented 10 years ago

Although, autoloading a variable is unnecessary for the purpose of setq and add-hook, I think an autoloaded variable still has the advantage that you can use add-to-list on it without requiring the package. But that's just a technicality. I don't think anyone uses it for that purpose.

shosti commented 10 years ago

I was thinking more in terms of the customize interface--it can't pick up non-autoloaded custom variables, right?

Malabarba commented 10 years ago

You can't customize a variable that hasn't been loaded, if that's what you mean. But after you customize a variable, you can safely restart emacs and the customization system won't have any problem with the variable not being loaded.