doomemacs/core/cli
Henrik Lissner 8903eebdc4
Change purpose of autodef cookie argument
;;;###autodef FORM

FORM was used as a predicate for inclusion as an autodef. Now it is used
as the replacement sexp in case the module is disabled.

Oh, you don't know what autdefs are? Well let me explain (thanks for
asking, by the way). An autdef'ed function, macro, or function alias is
always available to be called, anywhere in Doom, even if its containing
module is disabled. For instance:

  ;;;###autodef
  (defun say-hello! (name)  ; the trailing ! denotes an autodef
    (message "Hello %s" name))

This makes it safe to call `do-something` without a check whether it
exists (or if its module is enabled). When the module is enabled, an
autoload entry is added to the Doom autoloads file:

  (autoload 'do-something "path/to/some/modules/autoloads")

And it is autoloaded as normal when it is first used. However, if the
module is disabled, then this is inserted instead:

  (defmacro do-something (&rest _))

This no-ops; it does nothing and doesn't evaluate its arguments. If FORM
above was provided, that is used instead of a noop macro.

It's a little smarter than simple substitution, but that's the gist of
it.
2019-03-02 01:34:14 -05:00
..
autoloads.el Change purpose of autodef cookie argument 2019-03-02 01:34:14 -05:00
byte-compile.el Improve predicate fn for byte-compile targets 2018-12-06 17:45:53 -05:00
debug.el
packages.el Move doom--condition-case! to core/cli/packages 2019-01-10 15:44:42 -05:00
patch-macos.el
quickstart.el Don't always create dummy files on doom quickstart 2018-10-06 20:44:25 -04:00
test.el
upgrade.el Mention alternative in docs for bin/doom upgrade 2019-01-05 15:33:06 -05:00