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

Process user-config before command line arguments #7202

Closed
wants to merge 1 commit into from
Closed

Process user-config before command line arguments #7202

wants to merge 1 commit into from

Conversation

BinaryKhaos
Copy link

emacs-startup-hook is run after the command line arguments are being processed (and not at all if in batch mode). This has several undesired side-effects. If Emacs is started with file arguments, user-config is being run after the respective major mode has been initialized. Thus, variables set and code defined in user-config will not have the desired effect in that particular scenario. Also, in batch mode, user-config will not be evaluated at all which in some cases is not what the user might want and/or expect.

This refactors the handling of user-config to the after-init-hook and introduces another needed setup function for init.el.

emacs-startup-hook is run after the command line arguments are being
processed (and not at all if in batch mode). This has several undesired
side-effects. If Emacs is started with file arguments, user-config is
being run after the respective major mode has been initialized. Thus,
variables set and code defined in user-config will not have the desired
effect in that particular scenario. Also, in batch mode, user-config
will not be evaluated at all which in some cases is not what the user
might want and/or expect.

This refactors the handling of user-config to the after-init-hook and
introduces another needed setup function for init.el.
@Miciah
Copy link
Contributor

Miciah commented Jul 19, 2018

This PR seems to describe the same problem as #3233, which was closed as resolved in 0.200. Was there a regression?

Also related: #3808.

@hrldcpr
Copy link
Contributor

hrldcpr commented Jul 23, 2018

@Miciah I'm using the latest version of spacemacs, but I still experience this issue.

In particular, I have this code in my dotspacemacs/user-config:

(add-hook 'json-mode-hook 'prettier-js-mode)

…and prettier-js-mode is correctly enabled if I C-x C-f to a .json file, but not if I invoke spacemacs with emacs whatever.json

If, however, I move the code to dotspacemacs/user-init, then emacs whatever.json works correctly.

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this PR is still need merging!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@github-actions github-actions bot closed this May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants