Re: Purpose of jde-autoloads
Stephen Leake <[email protected]> Thu, 13 Aug 2015 17:45:50 -0500
| Newsgroups | gmane.emacs.jdee.devel |
|---|---|
| Message-ID | <[email protected]> |
Przemysław Wojnowski <[email protected]> writes: > I was thinking about purpose of autoloads and IIUC its sole purpose is to lazy > load parts of JDEE. But what for? Maybe 10-15 years ago it was speeding up > loading of JDEE, but now the difference is marginal. The only function I would > see in autoloads would be something like this: > (defun jde-start () > "Start JDEE." > (require 'jde)) > > Rationale: If someone would install JDEE (e.g. from elpa) it wouldn't slow down > Emacs startup. But user could load it anytime using M-x jde-start when s/he > would like to open a Java project. > > What do you think about it? To make that single require work this way means that jde.el needs a require for every other jde file; that's circular. One way to "fix" that is to have _every_ other file _only_ require jde. That's bad design; it means the byte-compiler cannot warn about functions/vars that are not visible, so files become hopelessly cross-connected. I just spent some effort reducing exactly that problem, in order to fix existing byte-compile errors. The code is still more cross-connected than it should be; hence all the FIXME: refactor comments. There is a way to get what you are asking for here; there could be a jde-load-all.el that is just a list of requires. In general, the Emacs style is to load things lazily, but in fairly large chunks. That works better for people on older/slower machines. In particular, anything that starts or uses an external process on load should be avoided and/or autoloaded. On the other hand, it can be difficult to tell when something needs an autoload, so the tendency is to add an autoload "just in case". So some sort of policy on when they should be added, and tests/checks for this, would be good. > I nobody mind or answer by the end of the week I'll reduce > jde-autoload to the > one method. We do not have sufficiently thorough tests of JDE, so we should not be making wholesale changes like this unless something is clearly broken. Is there something clearly broken with the current autoloads? -- -- Stephe ------------------------------------------------------------------------------ _______________________________________________ jdee-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jdee-devel