comint-truncate-buffer preforms expensive line-wise operations on every
line of output in the compilation buffer. This can exponentially slow
down every additional line of output thereafter. To get around this, I
relpace it with a version that rate-limits it until the compilation
buffer has grown large enough.
This may still have issues in cases where the underlying processes
produce long *and* ultra wide lines at the same time.
Ref: doomemacs/community#87
Introduces a systemic fix to the problem where most major modes don't
set `tab-width` and/or `standard-indent` to match the mode-specific
indent variables. This tries to guess the indent variable(s) for any
given major mode, by searching for variables that end in:
X-ts-mode-indent-offset
X-indent-offset
X-indent-level
X-tab-width
X-basic-offset
Where X is the major mode without the (base-)?(ts-)?-mode suffix. This
should resolve to the correctly variable for most popular or newer
packages. For modes where it isn't enough, modules will have to manually
register with `set-indent-vars!`.
This commit also moves various indent commands to a new
lisp/lib/indent.el library and rewrites `doom/set-indent-width` to use
this new API (which no longer depends on editorconfig, and less on
dtrt-indent).
Fix: #8713
This originally consisted of four hooks, intended to be a more
performant alternative to the built-in `{global-,}auto-revert-mode`.
However, users who don't want this behavior needed four relatively
obscure `remove-hook` calls to fully it. With this, folks only need:
(remove-hook 'doom-first-file-hook #'doom-auto-revert-mode)
Or can toggle `doom-auto-revert-mode` directly.
After v3, I plan to move this functionality into a module.
Ref: doomemacs/community#86
These two commands aren't used anywhere and the specifics of how
people *want* these sort of commands to work are so specialized and
niche that ours are unlikely to suit most people's needs. As an
alternative, Evil users already have `evil-shift-right` and
`evil-shift-left`, and vanilla users can `(setq tab-always-indent nil)`,
among *many* other possible choices.
There will be more of these set-variable-type autodefs in the future, so
I'd rather make the abbreviation of "variable" the precedent now than
destructively rename them all later.
To resist contamination from the current buffer or environment (e.g. due
to direnv). Also, ensure `doom-after-reload-hook` is executed, even if
the reload process fails.
Calling `doom-fallback-buffer` pulls in lisp/lib/buffers.el a sooner
than needed. `doom-fallback-buffer-name` on the other hand is defined
much sooner.
Warnings about unused lexical variables, arity warnings, unescaped
single quotes in docstrings, shadowed variables, and invalid value for
:local depending on Emacs version.
In recent versions of Emacs, `global-hl-line-mode` is separate from
`hl-line-mode`
(the global mode uses a different, more efficient mechanism for line
highlights), so it should bow out if `hl-line-mode` is enabled.
This function should not be used as a substitute for
`package-initialize`, to activate packages installed via package.el,
this is solely for metadata for Doom's package manager.
We were setting recentf-auto-cleanup to nil, which is not one of the
supported values in its defcustom type.
Set it to `'never` instead. This has exactly the same effect (recentf
only references `recentf-auto-cleanup` from a `cond` statement, which
does nothing for both values), but we might as well future-proof.
Clean up a duplicate assignment while I'm there.
Noticed because I had copied this into my personal config at some
point (to disable Doom's periodic save in daemon sessions) and recently
converted that config to use `setopt`, which complained.
Doom adds `recentf-cleanup` to `kill-emacs-hook`, but that function only
cleans up `recentf-list` without saving it to disk: saving is handled by
`recentf-save-list`. `recentf-mode` adds `recentf-save-list` to
`kill-emacs-hook` as well... but it only adds that hook when
`recentf-mode` is enabled, which means `recentf-save-list` ends up
before `recentf-cleanup` on `kill-emacs-hook`, rendering the cleanup
ineffective.
This is normally barely noticable, but with many paths on (slow) network
filesystems on `recentf-list` the cleanup can get slow enough to be
annoying.
Fix it by passing a priority to `add-hook`.
This leaves an ineffective cleanup call if we exit Emacs with
recentf-mode disabled, but that should normally only happen if we exit
Emacs without opening a file (`doom-first-file-hook` enables
recentf-mode). If that's an issue, we could add a function to
`recentf-mode-hook` which in turn adds to `emacs-term-hook`, but that
seems too complicated for little gain.
Emulating --init-directory has issues (e.g. isn't exposed to the *exact*
same $HOME environment), so if it's available (i.e. if Emacs 29+ is
being used or Doom lives in ~/.emacs.d or ~/.config/emacs), then use it.
This makes the 'doom emacs' command faster and more reliable as a launch
pad for Doom.
- Simplifies development build check explanation.
- Removes the 27 check, because Doom core will continue to support 27+
for the foreseeable future, but Doom's modules will be dropping 27 and
28 support soon, but that check will be done elsewhere.
Some were outdated, some were incorrectly labeled, others were already
completed, some were missing... Gotta fix them all.
Also, in :ui hl-todo, there are comments that describe how Doom uses
each of these annotations; those have been updated.
`persp-after-load-state-functions` functions must take arguments, but
`doom-kill-childframes-h` didn't take any, causing errors when loading
persp-mode sessions.
Fix: #8700
Amend: e5bbae8144
In the spirit of 6f40ad5, I'm deprecating this macro because it doesn't
provide enough value to exist and serves only to complicate a casual
reader's understanding of Doom's modules.
Ref: 6f40ad55f5
And use it to replace the various `posframe-delete-all` hooks littered
about to clean up child/posframes in contexts where they may linger
after destructive operations (like changing the active workspace or
executing `doom/reload`).
`setq!` was introduced to fix `setopt` pulling in packages. Now that
`setopt` was advised (in fad44ca228) to fix the issue at the source,
this macro is no longer necessary.
Ref: fad44ca228
Seems electric-quote-mode was already disabled by fault, but I was
troubleshooting a package that was globally enabling it in its
autoloads, so this setting wasn't needed.
Revert: 8e6d555cc4