jcsalomon / smarttabs

Emacs smart tabs - indent with tabs, align with spaces!
http://www.emacswiki.org/emacs/SmartTabs
114 stars 20 forks source link

Added cookies to facilitate autoloading #8

Closed alanpearce closed 12 years ago

alanpearce commented 12 years ago

Added autoload cookies to the functions and macros in smart-tabs-mode.el

I don't think that smart-tabs-advice should have a cookie, since ideally (at least to me) it would be evaluated in a mode hook or eval-after-load form after smart-tabs-mode(-enable) is called. However I decided to be consistent with the documentation, which doesn't use such a format.

jcsalomon commented 12 years ago

I googled [emacs autoload cookies] and turned up (elisp)Autoload, but I’m unclear on how this would be used. Do the instructions in the comments at the top of the file need to change at all to use auto-loading?

alanpearce commented 12 years ago

No, those instructions are fine. It's only for update-file-autoloads and its directory equivalent, which create (autoload) forms automatically in a given file (usually loaddefs.el). Packages such as el-get rely on those functions to automatically generate autoload forms. Thus the file (i.e. loaddefs.el) can be loaded with the autoload forms for a myriad of different elisp packages.

jcsalomon commented 12 years ago

Can you add some text to explain how to use this with autoload, then?

alanpearce commented 12 years ago

Does this seem reasonable?