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

Request for yet another user initialization function #4597

Closed
zot opened this issue Jan 13, 2016 · 4 comments
Closed

Request for yet another user initialization function #4597

zot opened this issue Jan 13, 2016 · 4 comments
Labels
Question stale marked as a stale issue/pr (usually by a bot)

Comments

@zot
Copy link

zot commented Jan 13, 2016

REQUEST: Would you please call a new user init function like dotspacemacs/user-packages-loaded or something, or maybe call dotspacemacs/user-config right after the call to configuration-layer//load-packages?

REASON: I just had to add a patch to flycheck because of a loading problem that was hanging Emacs when it turned flycheck-mode on for a buffer. Putting the patch into user-init was too early because require couldn't find flycheck.el and putting it into user-config was too late because the desktop had already been loaded, flycheck turned on, and Emacs completely hung. My solution was to advise configuration-layer//load-packages like this in my user-init function:

(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init'.  You are free to put almost any
user code here.  The exception is org related code, which should be placed in
`dotspacemacs/user-config'."
  (advice-add 'configuration-layer//load-packages :after
              (lambda (&rest args)
                (dotspacemacs/patch-flycheck))))

Adding advice to configuration-layer/sync did not work, by the way.

@zot
Copy link
Author

zot commented Jan 13, 2016

Actually, the problem was that I needed the patch before the initial desktop was restored, so the init function could be called right before that.

@syl20bnr
Copy link
Owner

Is there any desktop hook that you could use ?

@zot
Copy link
Author

zot commented Jan 14, 2016

There may be, but doesn't it make sense to call a user function right after packages have loaded? There may be many other cases like this that aren't desktop.

@github-actions
Copy link

This issue 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 issue is still valid!

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

No branches or pull requests

2 participants