-
Notifications
You must be signed in to change notification settings - Fork 44
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
General causing after-load-alist to grow #113
Comments
I can replicate this, but I don't have any ideas initially.
It's done in the same way as
The only significant difference that comes to mind is that when |
I think that was the hint I needed, I did a bit of bisecting in general.el, and it looks like this line is "causing" the issue. Weirdly, sticking a require or removing the body dosen't help, so
leaks, but
is fine? I'm more confused than I was before at this point... I'll keep investigating this some more, I'm guessing it has to do something with lexical scope and closures. From a basic test expanding the |
It turns out that this can reproduce it too:
so I don't think this is an issue in general at all. Feel free to close this if you wish, I'll probably file a bug report about it once I get more information... (EDIT: this actually seems intended, which is weird). It might be because "If a matching file is loaded again, FORM will be evaluated again." I think this might not be the behavior general wants :/ |
I've had a users who didn't want general to require evil but instead wait until it was loaded. It seems to me like |
That would be awesome, if you don't think it would break anything! I can also work on this eventually, but I probably won't have free time for the next couple of weeks. I agree with you on the option to |
I don't think this should cause any problems. Since This won't fix the problem if evil hasn't been loaded when eshell is run, but for that case, I'd say the fault is more with eshell for its buggy keymap handling making it necessary to run setup for every new instance. Otherwise duplicates wouldn't be repeatedly added to |
This is a rather odd issue, and I'm a lot more confused than I usually am with issues I submit. This could be an issue on my end, but I'd like to at least put it out here in case others are unwittingly running into the same problem I am.
I was troubleshooting memory leaks in my emacs, and I found that
after-load-alist
was rather large, much larger than I would have expected. After looking at it's value, I discovered that most of the entries were related to eshell (even though I couldn't fully understand what's going on).I then bisected my eshell config until I got a small reproducible init file.
When launching with this init file, first run M-x memory-usage, which will show you some basic stats. Then M-x memory-usage-find-large-variables, and note how
after-load-alist
is not in the list (it is too small to be listed).After running the
dotimes
script, run memory-usage-find-variables again, and compare it to the previous run. For me,after-load-alist
had grown to the largest variable in the list by almost an order of magnitude.I don't know much about the general internals, but I was able to find out that:
evil-define-key
directly dosen't leak:states
prevents the leakeshell-mode-hook
(ie: running them directly) does not leakI'd like to provide more information, but I don't know enough about general (and it's quite complex at this point). Please let me know if I can help in any way.
My best guess is that this is related to some
eval-after-load
(or other deferred loading) stuff, but I'm not sure. I found this in the docs:How is this done? As far as I know
eshell-mode-map
is available at that point, and(boundp 'eshell-mode-map)
seems to be true.The text was updated successfully, but these errors were encountered: