+ Removes redundant/unhelpful comments
+ Renames functions, hooks and variables to be self-documenting
+ Use add-to-list to ensure idempotency (and is more performant)
+ doom-before-switch-buffer-hook => doom-exit-buffer-hook
+ doom-before-switch-window-hook => doom-exit-window-hook
+ doom-after-switch-buffer-hook => doom-enter-buffer-hook
+ doom-after-switch-window-hook => doom-enter-window-hook
Shorter, easier-to-type names that better describe their intended
purpose.
The old names are still usable, but deprecated.
Causes char-table-p errors in some cases.
Setting hscroll-margin = 0 in dashboard accomplishes the same thing, by
preventing truncation glyphs from ever appearing anyway.
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.
The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
This will hopefully reveal more information as to the cause and origin
of errors at startup. It should also make doom-debug-mode more likely to
produce a backtrace in non-interactive sessions.
This naming convention was meant to be for batch commands, but it grew
to include "commands that were helpful with managing Doom", but many of
these commands shouldn't be interactive in the first place!
set-face-attribute wasn't reliable for changing the fixed-pitch and
variable-pitch faces. custom-set-faces uses a custom, internal user
theme that has the highest precedence, making this the superior choice
for default font-setting.
`display-graphic-p` returns a boolean (possibly a recent change in Emacs
27), which will never match any window system, causing the theme to be
reloaded on every new frame.
Also default doom-last-window-system to initial-window-system.
If you open emacs with a file (emacs file.txt), the file is switched to
before the switch-buffer hooks are set up. However, many core packages
are hooked to those switch-buffer hooks (to load when they're first
triggered). They miss the boat and don't get loaded.
These packages are now hooked onto after-find-file as well (and
immediately), which will fire when a file is opened, before or after
initialization.
Fixes#680
Normally doom|show-whitespace-maybe turns on whitespace-mode with a
subset of its features when indent-tabs-mode was different in that
buffer versus it's global default. e.g. If your default was spaces and
you opened a file with tabs.
This is to make it easier to notice whitespace style discrepancies.
However, it have side effects if whitespace-mode/global-whitespace-mode
was already on.
In certain edge cases, the buffer/window/frame switch would not make the
new buffer/window/frame current, which is what the after switch hooks
should reasonably expect, causing some shenanigans.
For example, persp wouldn't register magit buffers because
`doom-after-switch-buffer-hook` was run in the context of the previous
buffer.