Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .nosearch to modes/ to not litter subdirs.el
If you install evil-collection to site-lisp/, it's getting picked by Emacs and added to `subdirs.el` in order to populate the `load-path` at startup. To quote the official documentation: > For each directory in load-path, Emacs then checks to see if it contains > a file subdirs.el, and if so, loads it. The subdirs.el file is created when > Emacs is built/installed, and contains code that causes Emacs to add any > subdirectories of those directories to load-path. Both immediate subdirectories > and subdirectories multiple levels down are added. But it excludes subdirectories > whose names do not start with a letter or digit, and subdirectories named RCS > or CVS, and subdirectories containing a file named .nosearch. There are legitimate reasons why one may add evil-collection to site-lisp/: Linux distributions packaging it as native distro packages may lead to this for example. In my case, I'm using Nix and "Emacs Overlay", which is more or less a standard way to manage Emacs and its configuration under Nix. I've noticed that my Emacs starts slower than needed (0.6 seconds with configuration under Nix, and 0.2 seconds with configuration not managed by Nix). I've pin-pointed the issue to an explosion of `load-path`, which is one of the biggest performance hogs on Emacs startup. It seems that: - Many other packages add `.nosearch` to their subdirs to prevent automatic addition to load-path - There is no risk in introducing this to evil-collection, as it loads modules by absolute paths from the basedir of the main file. I've patched evil-collection and on my system it keeps working, while achieving a nice load speedup (almost 0.4 seconds). Please consider merging this.
- Loading branch information