Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scratch buffer initializing too early #7816

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dev380
Copy link
Contributor

@Dev380 Dev380 commented Apr 12, 2024

This is a daemon-only issue.
The scratch buffer is initialized very early
in the startup process. However, some minor
modes (such as flycheck-posframe-mode) and
other things that should run on every prog-mode
or elisp mode buffer won't get to set a hook and
have it run. This recreates the scratch buffer
the first time it's switched to to fix this.
For some reason, simply calling the major mode
hook for the scratch buffer after doom-after-init-hook
doesn't work.

For some reason, removing the check for the buffer name in the hook function (i.e. running it on the first buffer switch after doom-after-init-hook) also works, and the buffer switch hook runs automatically despite me not switching any buffers, but just doom-after-init-hook by itself doesn't work and I don't know why.


This is a daemon-only issue.
The scratch buffer is initialized very early
in the startup process. However, some minor
modes (such as `flycheck-posframe-mode`) and
other things that should run on every prog-mode
or elisp mode buffer won't get to set a hook and
have it run. This recreates the scratch buffer
the first time it's switched to to fix this.
For some reason, simply calling the major mode
hook for the scratch buffer after doom-after-init-hook
doesn't work.
@Dev380 Dev380 requested a review from a team as a code owner April 12, 2024 21:37
@hlissner hlissner added is:bug Something isn't working as intended module:core Relevant to Doom core was:moved Is, was, or will be addressed elsewhere labels Apr 22, 2024
@hlissner hlissner added this to the modules v24.06 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something isn't working as intended module:core Relevant to Doom core was:moved Is, was, or will be addressed elsewhere
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants