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

Ergoemacs loading ~5 seconds. #426

Closed
brs-dev opened this issue Aug 21, 2016 · 2 comments
Closed

Ergoemacs loading ~5 seconds. #426

brs-dev opened this issue Aug 21, 2016 · 2 comments

Comments

@brs-dev
Copy link

brs-dev commented Aug 21, 2016

Hi! Why ergoemacs have a load 5 seconds? But if i'm try use evil-mode load instant.

@mattfidler
Copy link
Member

mattfidler commented Sep 18, 2016

Good question.

evil-mode sets up a keymap immediately; it does not look up keybindings based on all the keymaps installed in emacs.

In the first start-up, ergoemacs-mode does the following:

  • Runs emacs without any extensions
  • Examines all the default keys of emacs
  • Saves the keymaps based on the emacs version and platform (some platforms have slightly different keys).

This should only occur once per emacs platform/version run.

The next thing that ergoemacs-mode does is:

  • Setup the translation between keyboard layouts that you are using (say Russian and QWERTY)
  • Setup the theme to work in the current environment

The last think is trying to lookup keys to ensure maximum compatability. This is done by:

  • examining every active keymap,
  • translating standard emacs keys to their equivalent in ergoemacs-mode.

This will usually allow the right actions, and maximum compatibility with emacs packages. For example, the save key will behave correctly in org-agenda-mode even though the commands are different. This is because both org-agenda-mode and default emacs define the key Ctrl+X Ctrl+S for the emacs save.

Sometimes, depending on your setup, some of these things are cached, and will take less time on startup. Unfortunately, I haven't figured out how to cache these so that the keys run almost instantaneously. You can submit a pull request if you have something that works instantly.

If you ever want to check what is slowing ergoemacs-mode, you can always issue the command Alt+a ergoemacs-timing-results to see where ergoemacs-mode is slowing down.

@brs-dev
Copy link
Author

brs-dev commented Sep 18, 2016

Thank you for response

@brs-dev brs-dev closed this as completed Sep 18, 2016
mattfidler added a commit that referenced this issue Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants