;;;###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.
Emacs occasionally hangs when polling for the emacs server (with
server-running-p). Since this is used for such a trivial feature (to
decide whether or not to display the "you need to restart" message), I
removed it. Now it always shows that message (if the autoload files have
changed).
It's possible for the debugger to be invoked from inside code wrapped in
a (quiet! ...) call. The debugger pauses Emacs in a broken state where
the functions locally rebound by quiet! (e.g. message, load-file,
write-region, etc) are never returned to their original definitions.
This attempts to reduce that probabilityby changing how quiet! silences
code. Rather than silencing them completely, they will be logged
to *Messages* but not displayed in the echo area.
Also, quiet! is now used less, where it isn't strictly needed (or where
inhibit-message is sufficient).
This should fix an issue where a package A, which uses macros from a
package B, is installed before package B, causing void-function errors.
The currently known and affected packages are neotree, parinfer, and
evil-collection.
Only add doom-private-dir to load-path during autoload generation,
otherwise a $DOOMDIR/autoload.el will shadow the built-in autoload.el
Emacs package.
Note: with `doom-private-dir' in `load-path', Doom autoloads files will
be unable to declare autoloads for the built-in autoload.el Emacs
package, should $DOOMDIR/autoload.el exist. Not sure why they'd want to
though, so it's an acceptable compromise for simpler autoload
declarations.
It is easier to spot real problems if the code is warning-free.
Replacing `gensym` with `make-symbol` is an idea taken from here:
b44c08dd45
In defer-until!:
core-lib.el:150:19:Warning: function ‘gensym’ from cl package called at
runtime
In add-transient-hook!:
core-lib.el:216:16:Warning: function ‘gensym’ from cl package called at
runtime
In toplevel form:
autoload/message.el:35:1:Warning: Unused lexical variable ‘spec’
In toplevel form:
autoload/line-numbers.el:31:1:Warning: defcustom for
‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:31:1:Warning: defcustom for
‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
‘display-line-numbers-width-start’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
‘display-line-numbers-width-start’ fails to specify containing group
In toplevel form:
cli/autoloads.el:137:1:Warning: Unused lexical variable ‘type’
Preserve name of unused lexical var _type
Makes it obvious what is stored there.
Color let-functions no longer take format string arguments. e.g.
(format! (red "Hello %s" "world"))
Becomes
(format! (red "Hello %s") "world")
The same goes for print!. Also, doom-ansi-apply now takes two arguments
instead of three.
Also merges doom-message-{fg,bg,fx} into doom-ansi-alist, and reduces
backtrace noise when errors originate from inside these macros.