[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defcustoms, how do users find them?

From: Stefan Monnier
Subject: Re: Defcustoms, how do users find them?
Date: Thu, 26 Nov 2009 21:09:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> So it ends up increasing Emacs's footprint by a bit less than
>> a megabyte.  It's not the end of the world, but it might be worthwhile
>> trying to avoid loading this data unless it's really needed.
> The easiest seems to be to split cus-load.el in two part and only load
> this extra part in C-h v etc.

I think C-h v, C-h f and very common operations which most of the time
do not need this info, so I'd like to avoid eating up 1MB just for that.

>> Of course, maybe there's a way to represent the same info
>> more compactly
> I doubt it is possible, but I do not understand all the figures.
> Does it help to erase the data again after C-h v?

Erasing the data after use might be a way around the problem.
Note that in the form in which you currently store the data (Customize
symbol properties), it's difficult to unload it.

If you additionally split the data (e.g. based on the first letter),
you'd end up only loading a tenth of the data at a time, which would
seem a lot more reasonable.

>> or to load it piecemeal (e.g. I've been using a local
>> hack where C-h v foo-bar RET will try to load foo.el if foo-bar is not
>> yet defined).
> Doesn't it need this data?

No it does it by guessing that "foo-bar" is probably in file foo.el
based on the prefix, so it doesn't need any data at all, but then it
only works in some cases.  And doesn't provide any completion at all.

Obviously, this is just a hack.  But maybe it can be turned into
something more robust.  E.g. we could collect a list of unique prefixes
for each file, so we could then easily figure out from a variable name
(or from a prefix) which (set of) files might provide variables of
that name.  And this data should be fairly compact.  Better yet: it
could be used to check/encourage use of the coding convention that
asks to use unique prefixes for namespace management: well-coded
packages will use less prefixes/less resources.

The main interest for me here is that this should work for defvars and
defuns as well, without much additional cost.

Ideally such a feature should use autoload.el rather than cus-dep.el, so
it can also work for unbundled packages.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]